Local declarations and initializers fixes (#222)
* captured values are stored in corresponding fields before call to super constructor * preserving the order of initializers * tests * refactoring * - test fix - workaround of IR bug * refactoring * review fix
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
val x: Int
|
||||
|
||||
init {
|
||||
x = 42
|
||||
}
|
||||
|
||||
val y = x
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println(Test().y)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
val x: Int
|
||||
|
||||
val y = 42
|
||||
|
||||
init {
|
||||
x = y
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println(Test().x)
|
||||
}
|
||||
Reference in New Issue
Block a user