[jvm] IDEA-269740 TestOnlyInspection add test for use-site targets

GitOrigin-RevId: fabc6ddc59d0c14d2c91722cd3dc9f26c21757a6
This commit is contained in:
Bart van Helvert
2021-08-03 21:04:31 +02:00
committed by intellij-monorepo-bot
parent 751f6ca133
commit db7e4cb2ec
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package test
import org.jetbrains.annotations.TestOnly
import org.jetbrains.annotations.VisibleForTesting
// IDEA-269740 need better support for UAST properties
@get:[TestOnly VisibleForTesting]
val x = 0
@get:[TestOnly]
val y = 0
@get:TestOnly
val z = 0
fun doSomething(q: Int) = q
fun main() {
doSomething(<warning descr="Test-only method is called in production code">y</warning>)
doSomething(<warning descr="Test-only method is called in production code">z</warning>)
}