Skip to content

Commit

Permalink
icsharpcode#1922: Fix hexadecimal integer literals missing the uL s…
Browse files Browse the repository at this point in the history
…uffix.
  • Loading branch information
dgrunwald committed Feb 14, 2020
1 parent 4b1f0b3 commit 8d780cc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,12 @@ public Expression ConvertConstantValue(IType expectedType, IType type, object co
string literalValue = null;
if (PrintIntegralValuesAsHex) {
literalValue = $"0x{constantValue:X}";
if (constantValue is uint || constantValue is ulong) {
literalValue += "u";
}
if (constantValue is long || constantValue is ulong) {
literalValue += "L";
}
}
expr = new PrimitiveExpression(constantValue, literalValue);
if (AddResolveResultAnnotations)
Expand Down

0 comments on commit 8d780cc

Please sign in to comment.