mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C#: Exclude interfaces and abstract classes from cs/call-to-object-tostring
This commit is contained in:
@@ -54,7 +54,9 @@ predicate alwaysDefaultToString(ValueOrRefType t) {
|
||||
not exists(RefType overriding |
|
||||
overriding.getAMethod() instanceof ToStringMethod and
|
||||
overriding.getABaseType+() = t
|
||||
)
|
||||
) and
|
||||
not t.isAbstract() and
|
||||
not t instanceof Interface
|
||||
}
|
||||
|
||||
newtype TDefaultToStringType = TDefaultToStringType0(ValueOrRefType t) { alwaysDefaultToString(t) }
|
||||
|
||||
Reference in New Issue
Block a user