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:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user