FIR checker: add diagnostics for backing fields
This commit is contained in:
committed by
Mikhail Glukhikh
parent
a88b82d8ff
commit
bd37badf29
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user