K1: add use-site diagnostic about property shadowing by a field

Related to KT-50082
This commit is contained in:
Mikhail Glukhikh
2022-10-14 15:21:03 +02:00
committed by teamcity
parent 59bafedd8a
commit 6234da4c86
15 changed files with 380 additions and 4 deletions
@@ -0,0 +1,48 @@
// WITH_STDLIB
// FILE: Base.java
public class Base {
public String regular = "a";
public String withGetter = "b";
public String lateInit = "c";
public String lazyProp = "d";
public String withSetter = "e";
public String openProp = "f";
}
// FILE: test.kt
open class Derived : Base() {
val regular = "aa"
val withGetter get() = "bb"
lateinit var lateInit: String
val lazyProp by lazy { "dd" }
var withSetter: String = "ee"
set(value) {
println(value)
field = value
}
open val openProp = "ff"
}
fun test(d: Derived) {
d.regular
d.withGetter
d.lateInit
d.lazyProp
d.withSetter = ""
d.openProp
d::withGetter
Derived::withGetter
}