diff --git a/ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs b/ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs index 078faa3816..c433c3b810 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/TransformDisplayClassUsage.cs @@ -549,7 +549,7 @@ ILVariable ResolveVariableToPropagate(ILInstruction value, IType expectedType = // "dc.field = v; v = 42; use(dc.field)" cannot turn to "v = 42; use(v);" return null; } - if (!(expectedType == null || v.Kind == VariableKind.StackSlot || v.Type.Equals(expectedType))) + if (!(expectedType == null || v.Kind == VariableKind.StackSlot || NormalizeTypeVisitor.IgnoreNullability.EquivalentTypes(v.Type, expectedType))) return null; return v; case LdObj ldfld: