Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/experimental/classMembersOverlyExperimental.fir.kt
T
Alexander Udalov f954a6c812 Support custom message in RequiresOptIn
#KT-34648 Fixed
2020-01-14 21:04:43 +01:00

37 lines
619 B
Kotlin
Vendored

// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt
package api
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
annotation class ExperimentalAPI
@ExperimentalAPI
class C {
@ExperimentalAPI
fun function() {}
@ExperimentalAPI
val property: String = ""
@ExperimentalAPI
class Nested {
@ExperimentalAPI
fun nestedFunction() {}
}
}
// FILE: usage.kt
package usage
import api.*
fun use() {
val c: C = C()
c.function()
c.property
C.Nested().nestedFunction()
}