C#: Add record deconstruct method as an exception from the bad practice rule.

This commit is contained in:
Michael Nebel
2022-01-18 12:51:01 +01:00
parent 2eea6ca5fd
commit 194da454b1

View File

@@ -39,6 +39,10 @@ private predicate acceptableShadowing(LocalScopeVariable v, Member m) {
)
or
t.getAConstructor().getAParameter() = v
or
// Record types have auto-generated Deconstruct methods, which declare an out parameter
// with the same name as the property field(s).
t.(RecordType).getAMethod("Deconstruct").getAParameter() = v
)
}