Fix this remapping in inner class constructors
Inner class constructors should use the argument instead of reading outer `this` from a field because if such an access happens before a delegating constructor call, e.g. when evaluating an argument, a JVM bytecode validation error will be thrown. (The only operation on `this` allowed before a delegating constructor call is SETFIELD, and only if the field in question is declared in the same class.)
This commit is contained in:
Vendored
+1
-2
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
interface Callback {
|
||||
fun invoke(): String
|
||||
}
|
||||
@@ -19,4 +18,4 @@ class Outer {
|
||||
}
|
||||
|
||||
fun box(): String =
|
||||
Outer().Inner().callback.invoke()
|
||||
Outer().Inner().callback.invoke()
|
||||
|
||||
Reference in New Issue
Block a user