Kotlin: Change Modifiable::isPublic to not cover Kotlin internal members

This commit is contained in:
Tamas Vajk
2022-08-30 14:37:22 +02:00
parent d9086e6328
commit 3513bb8eed
2 changed files with 5 additions and 3 deletions

View File

@@ -46,8 +46,11 @@ abstract class Modifiable extends Element {
// TODO: `isSealed()` conflicts with `ClassOrInterface.isSealed()`. What name do we want to use here?
predicate isSealedKotlin() { this.hasModifier("sealed") }
/** Holds if this element has a `public` modifier or is implicitly public. */
predicate isPublic() { this.hasModifier("public") }
/**
* Holds if this element has a `public` modifier or is implicitly public.
* Kotlin `internal` members, which are `public` in JVM Bytecode, are not considered `public`.
*/
predicate isPublic() { this.hasModifier("public") and not this.isInternal() }
/** Holds if this element has a `protected` modifier. */
predicate isProtected() { this.hasModifier("protected") }

View File

@@ -1,5 +1,4 @@
isPublic
| Kotlin.kt:2:11:3:2 | kotlinFun$main |
isInternal
| Kotlin.kt:2:11:3:2 | kotlinFun$main |
#select