allow delegated properties to have getters and setters without bodies

This commit is contained in:
Dmitry Jemerov
2015-03-04 13:50:58 +01:00
committed by Andrey Breslav
parent 8ba15937f9
commit e9266481c5
7 changed files with 60 additions and 3 deletions
@@ -0,0 +1,10 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
val a: Int by Delegate()
get
class Delegate {
fun get(t: Any?, p: PropertyMetadata): Int {
return 1
}
}
@@ -0,0 +1,11 @@
package
internal val a: kotlin.Int
internal final class Delegate {
public constructor Delegate()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
internal final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -0,0 +1,12 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
var a: Int by Delegate()
private set
class Delegate {
fun get(t: Any?, p: PropertyMetadata): Int {
return 1
}
fun set(t: Any?, p: PropertyMetadata, i: Int) {}
}
@@ -0,0 +1,12 @@
package
internal var a: kotlin.Int
internal final class Delegate {
public constructor Delegate()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
internal final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
internal final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}