From 8d780cc921821ae616424c0ce9549ed1530c222f Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Fri, 14 Feb 2020 23:12:29 +0100 Subject: [PATCH] #1922: Fix hexadecimal integer literals missing the `uL` suffix. --- .../CSharp/Syntax/TypeSystemAstBuilder.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs index ddb950d0a..fb8ef0695 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs @@ -787,6 +787,12 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax 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)