Synthetic 'field' variable is no more created in extension property accessors #KT-9303 Fixed
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// 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 = <!PROPERTY_INITIALIZER_NO_BACKING_FIELD!>13<!>
|
||||
// Error
|
||||
get() = <!UNRESOLVED_REFERENCE!>field<!>
|
||||
|
||||
class My {
|
||||
val String.x: Int = <!PROPERTY_INITIALIZER_NO_BACKING_FIELD!>7<!>
|
||||
// Error
|
||||
get() = <!UNRESOLVED_REFERENCE!>field<!>
|
||||
}
|
||||
Reference in New Issue
Block a user