Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFile.kt
T
Alexander Udalov 0bf0a315ed Introduce Experimental and UseExperimental annotations
#KT-22759 In Progress
2018-02-08 17:07:21 +01:00

38 lines
735 B
Kotlin
Vendored

// !API_VERSION: 1.3
// FILE: api.kt
package api
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
@Target(AnnotationTarget.FUNCTION)
annotation class CompilationExperimentalAPI
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.RUNTIME])
@Target(AnnotationTarget.FUNCTION)
annotation class RuntimeExperimentalAPI
@CompilationExperimentalAPI
fun compilation() {}
@RuntimeExperimentalAPI
fun runtime() {}
// FILE: usage.kt
@file:UseExperimental(CompilationExperimentalAPI::class)
package usage
import api.*
fun use() {
compilation()
<!EXPERIMENTAL_API_USAGE!>runtime<!>()
}
class Use {
fun use() {
compilation()
<!EXPERIMENTAL_API_USAGE!>runtime<!>()
}
}