Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/experimental/classMembersOverlyExperimental.fir.kt
T
2021-06-08 11:37:27 +03:00

38 lines
658 B
Kotlin
Vendored

// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt
package api
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.BINARY)
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()
}