Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFile.kt
T
Alexander Udalov 29c35e6686 Do not require experimental propagation for body usages in same module
Unless it's a usage inside the body of an effectively public inline
function

 #KT-22759 In Progress
2018-02-08 17:07:22 +01:00

40 lines
772 B
Kotlin
Vendored

// !API_VERSION: 1.3
// MODULE: api
// 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() {}
// MODULE: usage(api)
// 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<!>()
}
}