C#: Exclude interfaces and abstract classes from cs/call-to-object-tostring

This commit is contained in:
calum
2019-01-11 15:53:32 +00:00
parent 83e2689645
commit 931b6b4ee5
2 changed files with 10 additions and 1 deletions

View File

@@ -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) }