From bb10f5a6a6ec027158da16b2e3435f2ce81e5a03 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 8 Jun 2019 17:21:15 +0200 Subject: [PATCH] Fix #1528: Show default value of nullable parameters as null. --- ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs index 7752d667e..2c13f6f56 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs @@ -739,7 +739,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax if (type == null) throw new ArgumentNullException("type"); if (constantValue == null) { - if (type.IsReferenceType == true) { + if (type.IsReferenceType == true || type.IsKnownType(KnownTypeCode.NullableOfT)) { var expr = new NullReferenceExpression(); if (AddResolveResultAnnotations) expr.AddAnnotation(new ConstantResolveResult(SpecialType.NullType, null));