f954a6c812
#KT-34648 Fixed
37 lines
619 B
Kotlin
Vendored
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()
|
|
}
|