Browse Source

Merge pull request #4127 from icsharpcode/tests/autoproperties-nullable

Ignore nullability when comparing backing field and property type of auto properties
pull/4128/head
Siegfried Pammer 7 days ago committed by GitHub
parent
commit
addf4ce1a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  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