JetBrains / JetBrains/java-annotations

VisibleForTesting behaviour is undefined for Kotlin code

Abierto
#97 0 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Kotlin
Estrellas
463
Forks
72
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.