Repository navigation
Conversation
ExpressionTranslator wrote decimal, long, uint and ulong constants with the current culture, so under a culture such as tr-TR 1.5m was emitted as "1,5m", which is not valid C#. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
@menes97 Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ExpressionTranslator.WriteValuewritesdecimal,long,uintandulongconstants withvalue.ToString(), which uses the current culture. Under tr-TR (or any culture with,as the decimal separator),Expression.Constant(1.5m).ToScript()emits1,5m, which isn't valid C#. Thedoubleandfloatcases right above already useCultureInfo.InvariantCulture; these four now do too (Convert.ToString(value, CultureInfo.InvariantCulture)).Test.
DebugInfoInjectorTest.TestDecimalConstantDoesNotDependOnCurrentCulturesets the culture to tr-TR, translatesExpression.Constant(1.5m)and checks the script contains1.5m. It fails without the change (the script has1,5m) and passes with it.Ran:
ExpressionDebugger.Tests41/41 on net48. The net6.0/net7.0 targets weren't run here (runtimes not installed), and I didn't rerunMapster.Testsafter this one-line change.This change was written with Claude Code.
🤖 Generated with Claude Code