blob: e006f2f5316731455fc66c28ed9fbe29f277843f [file]
// IGNORE_BACKEND_K1: ANY
// LANGUAGE: +ContextParameters
class A(val x: String) {
fun foo(): String {
return x
}
}
var result = ""
context(a: A)
fun test1(): String {
val a = A("O")
return a.foo()
}
context(a: A)
fun test2(): String {
val temp = a.foo()
val a = A("not OK")
return temp
}
fun box(): String {
with(A("not OK")) {
result += test1()
}
with(A("K")) {
result += test2()
}
return result
}