KT-16904 Wrong IR when applying some operators to superclass properties in constructor

Use property accessors for assignment generation for inherited properties in constructor.
This commit is contained in:
Dmitry Petrov
2017-03-17 14:24:11 +03:00
parent 5405c81106
commit d05de88e3e
4 changed files with 120 additions and 15 deletions
+30
View File
@@ -0,0 +1,30 @@
// FILE: J.java
public class J {
public int field = 0;
}
// FILE: kt16904.kt
abstract class A {
val x = B()
var y = 0
}
class B {
operator fun plusAssign(x: Int) {
}
}
class Test1 : A {
constructor() {
x += 42
y += 42
}
}
class Test2 : J() {
init {
field = 42
}
}