Local delegated properties.

This commit is contained in:
Dmitry Petrov
2016-09-02 10:18:06 +03:00
committed by Dmitry Petrov
parent e42116bb6a
commit 42988383e0
22 changed files with 490 additions and 201 deletions
@@ -51,7 +51,7 @@ FILE /delegatedImplementation.kt
CONSTRUCTOR public constructor Test1()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=Test1
DELEGATE val `Test1$IBase$delegate`: BaseImpl
PROPERTY val `Test1$IBase$delegate`: BaseImpl
EXPRESSION_BODY
GET_OBJECT BaseImpl type=BaseImpl
FUN public open override /*1*/ /*delegation*/ fun foo(/*0*/ x: kotlin.Int, /*1*/ s: kotlin.String): kotlin.Unit
@@ -74,7 +74,7 @@ FILE /delegatedImplementation.kt
CONSTRUCTOR public constructor Test2()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=Test2
DELEGATE val `Test2$IBase$delegate`: BaseImpl
PROPERTY val `Test2$IBase$delegate`: BaseImpl
EXPRESSION_BODY
GET_OBJECT BaseImpl type=BaseImpl
FUN public open override /*1*/ /*delegation*/ fun foo(/*0*/ x: kotlin.Int, /*1*/ s: kotlin.String): kotlin.Unit
@@ -93,7 +93,7 @@ FILE /delegatedImplementation.kt
CALL .qux type=kotlin.Unit operator=null
$this: GET_VAR Test2$IBase$delegate type=BaseImpl operator=null
$receiver: $RECEIVER of: qux type=kotlin.String
DELEGATE val `Test2$IOther$delegate`: IOther
PROPERTY val `Test2$IOther$delegate`: IOther
EXPRESSION_BODY
CALL .otherImpl type=IOther operator=null
x0: CONST String type=kotlin.String value=''
@@ -14,7 +14,7 @@ FILE /delegatedImplementationWithExplicitOverride.kt
CONSTRUCTOR public constructor C()
BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor=C
DELEGATE val `C$IFooBar$delegate`: FooBarImpl
PROPERTY val `C$IFooBar$delegate`: FooBarImpl
EXPRESSION_BODY
GET_OBJECT FooBarImpl type=FooBarImpl
FUN public open override /*1*/ /*delegation*/ fun foo(): kotlin.Unit
@@ -1,6 +1,6 @@
FILE /delegatedProperties.kt
PROPERTY public val test1: kotlin.Int
DELEGATE val `test1$delegate`: kotlin.Lazy<kotlin.Int>
delegate: PROPERTY val `test1$delegate`: kotlin.Lazy<kotlin.Int>
EXPRESSION_BODY
CALL .lazy type=kotlin.Lazy<kotlin.Int> operator=null
initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA
@@ -13,7 +13,7 @@ FILE /delegatedProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from=<get-test1>
CALL .getValue type=kotlin.Int operator=null
$receiver: GET_VAR test1$delegate type=kotlin.Lazy<kotlin.Int> operator=null
$receiver: GET_BACKING_FIELD test1$delegate type=kotlin.Lazy<kotlin.Int> operator=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE public val test1: kotlin.Int type=kotlin.reflect.KProperty0<kotlin.Int>
CLASS CLASS C
@@ -26,7 +26,7 @@ FILE /delegatedProperties.kt
EXPRESSION_BODY
GET_VAR map type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> operator=INITIALIZE_PROPERTY_FROM_PARAMETER
PROPERTY public final val test2: kotlin.Int
DELEGATE val `test2$delegate`: kotlin.Lazy<kotlin.Int>
delegate: PROPERTY val `test2$delegate`: kotlin.Lazy<kotlin.Int>
EXPRESSION_BODY
CALL .lazy type=kotlin.Lazy<kotlin.Int> operator=null
initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA
@@ -39,11 +39,11 @@ FILE /delegatedProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from=<get-test2>
CALL .getValue type=kotlin.Int operator=null
$receiver: GET_VAR test2$delegate type=kotlin.Lazy<kotlin.Int> operator=null
$receiver: GET_BACKING_FIELD test2$delegate type=kotlin.Lazy<kotlin.Int> operator=null
thisRef: THIS public final class C type=C
property: CALLABLE_REFERENCE public final val test2: kotlin.Int type=kotlin.reflect.KProperty1<C, kotlin.Int>
PROPERTY public final var test3: kotlin.Any
DELEGATE val `test3$delegate`: kotlin.collections.MutableMap<kotlin.String, kotlin.Any>
delegate: PROPERTY val `test3$delegate`: kotlin.collections.MutableMap<kotlin.String, kotlin.Any>
EXPRESSION_BODY
CALL .<get-map> type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> operator=GET_PROPERTY
$this: THIS public final class C type=C
@@ -51,33 +51,33 @@ FILE /delegatedProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from=<get-test3>
CALL .getValue type=kotlin.Any operator=null
$receiver: GET_VAR test3$delegate type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> operator=null
$receiver: GET_BACKING_FIELD test3$delegate type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> operator=null
thisRef: THIS public final class C type=C
property: CALLABLE_REFERENCE public final var test3: kotlin.Any type=kotlin.reflect.KMutableProperty1<C, kotlin.Any>
PROPERTY_SETTER public final fun <set-test3>(/*0*/ <set-?>: kotlin.Any): kotlin.Unit
BLOCK_BODY
RETURN type=kotlin.Nothing from=<set-test3>
CALL .setValue type=kotlin.Unit operator=null
$receiver: GET_VAR test3$delegate type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> operator=null
$receiver: GET_BACKING_FIELD test3$delegate type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> operator=null
thisRef: THIS public final class C type=C
property: CALLABLE_REFERENCE public final var test3: kotlin.Any type=kotlin.reflect.KMutableProperty1<C, kotlin.Any>
value: GET_VAR <set-?> type=kotlin.Any operator=null
PROPERTY public var test4: kotlin.Any
DELEGATE val `test4$delegate`: java.util.HashMap<kotlin.String, kotlin.Any>
delegate: PROPERTY val `test4$delegate`: java.util.HashMap<kotlin.String, kotlin.Any>
EXPRESSION_BODY
CALL .hashMapOf type=java.util.HashMap<kotlin.String, kotlin.Any> operator=null
PROPERTY_GETTER public fun <get-test4>(): kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from=<get-test4>
CALL .getValue type=kotlin.Any operator=null
$receiver: GET_VAR test4$delegate type=java.util.HashMap<kotlin.String, kotlin.Any> operator=null
$receiver: GET_BACKING_FIELD test4$delegate type=java.util.HashMap<kotlin.String, kotlin.Any> operator=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE public var test4: kotlin.Any type=kotlin.reflect.KMutableProperty0<kotlin.Any>
PROPERTY_SETTER public fun <set-test4>(/*0*/ <set-?>: kotlin.Any): kotlin.Unit
BLOCK_BODY
RETURN type=kotlin.Nothing from=<set-test4>
CALL .setValue type=kotlin.Unit operator=null
$receiver: GET_VAR test4$delegate type=java.util.HashMap<kotlin.String, kotlin.Any> operator=null
$receiver: GET_BACKING_FIELD test4$delegate type=java.util.HashMap<kotlin.String, kotlin.Any> operator=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE public var test4: kotlin.Any type=kotlin.reflect.KMutableProperty0<kotlin.Any>
value: GET_VAR <set-?> type=kotlin.Any operator=null
@@ -0,0 +1,4 @@
fun test1() {
val x by lazy { 42 }
println(x)
}
@@ -0,0 +1,21 @@
FILE /localDelegatedProperties.kt
FUN public fun test1(): kotlin.Unit
BLOCK_BODY
? IrLocalDelegatedPropertyImpl x
VAR val `x$delegate`: kotlin.Lazy<kotlin.Int>
CALL .lazy type=kotlin.Lazy<kotlin.Int> operator=null
initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA
FUN local final fun <anonymous>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from=<anonymous>
CONST Int type=kotlin.Int value='42'
CALLABLE_REFERENCE local final fun <anonymous>(): kotlin.Int type=() -> kotlin.Int
? IrLocalPropertyAccessorImpl <get-x>
BLOCK_BODY
RETURN type=kotlin.Nothing from=<get-x>
CALL .getValue type=kotlin.Int operator=null
$receiver: GET_VAR x$delegate type=kotlin.Lazy<kotlin.Int> operator=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE val x: kotlin.Int type=kotlin.reflect.KProperty0<kotlin.Int>
CALL .println type=kotlin.Unit operator=null
message: GET_VAR x type=kotlin.Int operator=null