JetBrains / JetBrains/java-annotations

VisibleForTesting behaviour is undefined for Kotlin code

Aperta
#97 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Kotlin
Stelle
463
Fork
72
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The documentation for the `VisibleForTesting` documentation is unclear on what the intended behaviour should be for Kotlin code.

The documentation leads you to believe that a Kotlin public member annotated with `@VisibleForTesting` should otherwise be considered package-private; however, Kotlin has no package-private visibility, and the one-less-than-public visibility to apply is [`internal`](https://kotlinlang.org/docs/visibility-modifiers.html).

This makes the annotation useless in Kotlin code, because if it is enforced, it means you can't use annotated symbols in the `internal` scope, but you can use them in the narrower but inexistent package-private scope.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.