Browse Source

Ignore nullability when comparing backing field and property type of auto properties

pull/4127/head
Siegfried Pammer 7 days ago
parent
commit
ebb8697e13
  1. 2
      ICSharpCode.Decompiler/CSharp/Transforms/PatternStatementTransform.cs

2
ICSharpCode.Decompiler/CSharp/Transforms/PatternStatementTransform.cs

@ -949,7 +949,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms @@ -949,7 +949,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
// structurally; arbitrary accessor bodies do not. A field of a different
// type is not this property's storage, and removing it while printing
// `field` would substitute storage of the property's type instead.
&& candidate.Type.Equals(propertyType)
&& NormalizeTypeVisitor.IgnoreNullability.EquivalentTypes(candidate.ReturnType, propertyType)
&& NameCouldBeBackingFieldOfAutomaticProperty(candidate.Name, out var propertyName)
&& propertyName == property.Name)
{

Loading…
Cancel
Save