Synthetic 'field' variable is no more created in extension property accessors #KT-9303 Fixed

This commit is contained in:
Mikhail Glukhikh
2015-09-28 16:41:44 +03:00
parent 7b4f18035f
commit 3d6d527d93
4 changed files with 37 additions and 2 deletions
@@ -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<!>
}
@@ -0,0 +1,12 @@
package
public val kotlin.String.bar: kotlin.Int = 13
public val kotlin.String.foo: kotlin.Int
public final class My {
public constructor My()
public final val kotlin.String.x: kotlin.Int = 7
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}