FIR checker: add diagnostics for backing fields

This commit is contained in:
Jinseong Jeon
2021-02-02 13:25:59 -08:00
committed by Mikhail Glukhikh
parent a88b82d8ff
commit bd37badf29
27 changed files with 89 additions and 84 deletions
@@ -1,17 +0,0 @@
// See KT-9303: synthetic field variable does not exist for extension properties
val String.foo: Int
get() {
// No shadowing here
val field = 42
return field
}
val String.bar: Int = 13
// Error
get() = <!UNRESOLVED_REFERENCE!>field<!>
class My {
val String.x: Int = 7
// Error
get() = <!UNRESOLVED_REFERENCE!>field<!>
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// See KT-9303: synthetic field variable does not exist for extension properties
val String.foo: Int
get() {
@@ -1,4 +0,0 @@
interface My {
val x: Int = <!PROPERTY_INITIALIZER_IN_INTERFACE!>0<!>
get() = field
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface My {
<!BACKING_FIELD_IN_INTERFACE!>val x: Int<!> = <!PROPERTY_INITIALIZER_IN_INTERFACE!>0<!>
get() = field