Tests for issues fixed in JVM_IR
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// IGNORE_BACKEND: JVM
|
||||
open class Base(val fn: () -> String)
|
||||
|
||||
class Test(x: String) :
|
||||
Base({
|
||||
class Local(val t: String = x)
|
||||
Local().t
|
||||
})
|
||||
|
||||
fun box() =
|
||||
Test("OK").fn()
|
||||
@@ -0,0 +1,16 @@
|
||||
// IGNORE_BACKEND: JVM
|
||||
class X(val x: String) {
|
||||
open inner class Y {
|
||||
fun foo() = x
|
||||
}
|
||||
|
||||
fun foo(s: String): String {
|
||||
with(X(s+x)) {
|
||||
val obj = object : Y() {}
|
||||
return obj.foo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box() =
|
||||
X("K").foo("O")
|
||||
@@ -0,0 +1,22 @@
|
||||
// IGNORE_BACKEND: JVM
|
||||
fun <T, R> with2(receiver: T, block: T.() -> R): R {
|
||||
return receiver.block()
|
||||
}
|
||||
|
||||
class X(val x: String) {
|
||||
open inner class Y {
|
||||
fun foo() = x
|
||||
}
|
||||
|
||||
fun foo(s: String): String {
|
||||
var t = ""
|
||||
with2(X(s+x)) {
|
||||
val obj = object : Y() {}
|
||||
t = obj.foo()
|
||||
}
|
||||
return t
|
||||
}
|
||||
}
|
||||
|
||||
fun box() =
|
||||
X("K").foo("O")
|
||||
Reference in New Issue
Block a user