Visibility consistency query: allow $default methods to have package-private (default) visibility

This commit is contained in:
Chris Smowton
2022-10-06 11:03:45 +01:00
parent 34b83f01d0
commit 764c139e3e

View File

@@ -19,5 +19,6 @@ where
// TODO: This ought to have visibility information
not m.getName() = "<clinit>" and
count(visibility(m)) != 1 and
not (count(visibility(m)) = 2 and visibility(m) = "public" and visibility(m) = "internal") // This is a reasonable result, since the JVM symbol is declared public, but Kotlin metadata flags it as internal
not (count(visibility(m)) = 2 and visibility(m) = "public" and visibility(m) = "internal") and // This is a reasonable result, since the JVM symbol is declared public, but Kotlin metadata flags it as internal
not (count(visibility(m)) = 0 and m.getName().matches("%$default")) // This is a reasonable result because the $default forwarder methods corresponding to private methods are package-private.
select m, concat(visibility(m), ", ")