Introduce KProperty{1,2}.getExtensionDelegate

These two functions are supposed to fix an inconvenience in the design of
KProperty{1,2}.getDelegate for extension properties, where you have to pass an
instance of the extension receiver which is going to be completely ignored

 #KT-8384 Fixed
This commit is contained in:
Alexander Udalov
2017-01-18 18:15:24 +03:00
parent 78f2515e95
commit ebd577e52a
9 changed files with 154 additions and 0 deletions
@@ -0,0 +1,24 @@
@kotlin.Metadata
public final class Delegate {
public final static field INSTANCE: Delegate
private method <init>(): void
public final method getValue(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.reflect.KProperty): boolean
}
@kotlin.Metadata
public final class Foo {
private synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[]
private final @org.jetbrains.annotations.NotNull field member$delegate: Delegate
private final @org.jetbrains.annotations.NotNull field memberExtension$delegate: Delegate
public method <init>(): void
public final method getMember(): boolean
public final method getMemberExtension(@org.jetbrains.annotations.NotNull p0: java.lang.String): boolean
}
@kotlin.Metadata
public final class GetExtensionDelegateKt {
private synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[]
private final static @org.jetbrains.annotations.NotNull field extension$delegate: Delegate
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
public final static method getExtension(@org.jetbrains.annotations.NotNull p0: Foo): boolean
}