KT-3523: VerifyError for invoke function in inner class
KT-4106: VerifyError: Can't access outer this in a lambda in inner class' constructor KT-3152: VerifyError when accessing from a function of object to a field of outer outer class #KT-3523 Fixed #KT-4106 Fixed #KT-3152 Fixed
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
public class Test {
|
||||
val content = 1
|
||||
inner class A {
|
||||
val v = object {
|
||||
fun f() = content
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
Test().A()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
open class Base {
|
||||
fun doSomething() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class X(val action: () -> Unit) { }
|
||||
|
||||
class Foo : Base() {
|
||||
inner class Bar() {
|
||||
val x = X({ doSomething() })
|
||||
}
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
Foo().Bar()
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
class Foo(private val s: String) {
|
||||
private inner class Inner {
|
||||
private val x = {
|
||||
this@Foo.s
|
||||
}()
|
||||
}
|
||||
|
||||
val f = Inner()
|
||||
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
Foo("!")
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user