Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/experimental/classMembersOverlyExperimental.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

39 lines
862 B
Kotlin
Vendored

// !API_VERSION: 1.3
// MODULE: api
// FILE: api.kt
package api
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
@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() {}
}
}
// MODULE: usage(api)
// FILE: usage.kt
package usage
import api.*
fun use() {
val c: <!EXPERIMENTAL_API_USAGE!>C<!> = <!EXPERIMENTAL_API_USAGE!>C<!>()
c.<!EXPERIMENTAL_API_USAGE!>function<!>()
c.<!EXPERIMENTAL_API_USAGE!>property<!>
<!EXPERIMENTAL_API_USAGE!>C<!>.<!EXPERIMENTAL_API_USAGE!>Nested<!>().<!EXPERIMENTAL_API_USAGE!>nestedFunction<!>()
}