mirror of
https://github.com/github/codeql.git
synced 2026-04-23 07:45:17 +02:00
C#: Add record deconstruct method as an exception from the bad practice rule.
This commit is contained in:
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user