JetBrains / JetBrains/java-annotations

VisibleForTesting behaviour is undefined for Kotlin code

オープン
#97 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Kotlin
スター
463
フォーク
72
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。