Skip to content

Commit 764c139

Browse files
committed
Visibility consistency query: allow $default methods to have package-private (default) visibility
1 parent 34b83f0 commit 764c139

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

java/ql/consistency-queries/visibility.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ where
1919
// TODO: This ought to have visibility information
2020
not m.getName() = "<clinit>" and
2121
count(visibility(m)) != 1 and
22-
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
22+
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
23+
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.
2324
select m, concat(visibility(m), ", ")

0 commit comments

Comments
 (0)