Files
kotlin-fork/compiler/testData/codegen/box/properties/genericPropertyMultiModule.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

38 lines
590 B
Kotlin
Vendored

// WITH_STDLIB
// MODULE: lib
// FILE: common.kt
class C<T>(var t: T)
class G<T>(var t: T)
var <T> C<T>.live: T
get() {
return t
}
set(value) {
t = value
}
var <T> G<T>.live: T
get() {
return t
}
set(value) {
t = value
}
// MODULE: main(lib)
// FILE: main.kt
import kotlin.reflect.KMutableProperty0
fun qux(text: KMutableProperty0<String>, s: String): String {
text.set(s)
return text.get()
}
fun box(): String {
val c = C("FAIL_C")
val g = G("FAIL_G")
return qux(c::live, "O") + qux(g::live, "K")
}