Callable references now can have receivers and arguments

(for bound references implementation).
This commit is contained in:
Dmitry Petrov
2016-09-02 17:31:43 +03:00
committed by Dmitry Petrov
parent fe397eddbe
commit a3dadd9e3f
16 changed files with 45 additions and 68 deletions
@@ -8,14 +8,14 @@ FILE /delegatedProperties.kt
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
CALLABLE_REFERENCE <anonymous> type=() -> kotlin.Int operator=LAMBDA
PROPERTY_GETTER public fun <get-test1>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from=<get-test1>
CALL .getValue type=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>
property: CALLABLE_REFERENCE test1 type=kotlin.reflect.KProperty0<kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
CLASS CLASS C
CONSTRUCTOR public constructor C(/*0*/ map: kotlin.collections.MutableMap<kotlin.String, kotlin.Any>)
BLOCK_BODY
@@ -34,14 +34,14 @@ FILE /delegatedProperties.kt
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
CALLABLE_REFERENCE <anonymous> type=() -> kotlin.Int operator=LAMBDA
PROPERTY_GETTER public final fun <get-test2>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from=<get-test2>
CALL .getValue type=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: CALLABLE_REFERENCE test2 type=kotlin.reflect.KProperty1<C, kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
PROPERTY public final var test3: kotlin.Any
delegate: PROPERTY val `test3$delegate`: kotlin.collections.MutableMap<kotlin.String, kotlin.Any>
EXPRESSION_BODY
@@ -53,14 +53,14 @@ FILE /delegatedProperties.kt
CALL .getValue type=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: CALLABLE_REFERENCE test3 type=kotlin.reflect.KMutableProperty1<C, kotlin.Any> operator=PROPERTY_REFERENCE_FOR_DELEGATE
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_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: CALLABLE_REFERENCE test3 type=kotlin.reflect.KMutableProperty1<C, kotlin.Any> operator=PROPERTY_REFERENCE_FOR_DELEGATE
value: GET_VAR <set-?> type=kotlin.Any operator=null
PROPERTY public var test4: kotlin.Any
delegate: PROPERTY val `test4$delegate`: java.util.HashMap<kotlin.String, kotlin.Any>
@@ -72,12 +72,12 @@ FILE /delegatedProperties.kt
CALL .getValue type=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: CALLABLE_REFERENCE test4 type=kotlin.reflect.KMutableProperty0<kotlin.Any> operator=PROPERTY_REFERENCE_FOR_DELEGATE
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_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: CALLABLE_REFERENCE test4 type=kotlin.reflect.KMutableProperty0<kotlin.Any> operator=PROPERTY_REFERENCE_FOR_DELEGATE
value: GET_VAR <set-?> type=kotlin.Any operator=null
@@ -9,14 +9,14 @@ FILE /localDelegatedProperties.kt
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
CALLABLE_REFERENCE <anonymous> type=() -> kotlin.Int operator=LAMBDA
LOCAL_PROPERTY_ACCESSOR <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>
property: CALLABLE_REFERENCE x type=kotlin.reflect.KProperty0<kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
CALL .println type=kotlin.Unit operator=null
message: CALL .<get-x> type=kotlin.Int operator=GET_LOCAL_PROPERTY
FUN public fun test2(): kotlin.Unit
@@ -30,7 +30,7 @@ FILE /localDelegatedProperties.kt
CALL .getValue type=kotlin.Int operator=null
$receiver: GET_VAR x$delegate type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE var x: kotlin.Int type=kotlin.reflect.KMutableProperty0<kotlin.Int>
property: CALLABLE_REFERENCE x type=kotlin.reflect.KMutableProperty0<kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
LOCAL_PROPERTY_ACCESSOR <set-x>
BLOCK_BODY
RETURN type=kotlin.Nothing from=<set-x>
@@ -38,7 +38,7 @@ FILE /localDelegatedProperties.kt
CALL .setValue type=kotlin.Unit operator=null
$receiver: GET_VAR x$delegate type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE var x: kotlin.Int type=kotlin.reflect.KMutableProperty0<kotlin.Int>
property: CALLABLE_REFERENCE x type=kotlin.reflect.KMutableProperty0<kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
value: GET_VAR value type=kotlin.Int operator=null
CALL .<set-x> type=kotlin.Int operator=EQ
value: CONST Int type=kotlin.Int value='0'
@@ -12,23 +12,23 @@ FILE /reflectionLiterals.kt
CONST Int type=kotlin.Int value='42'
PROPERTY public val test1: kotlin.reflect.KClass<A>
EXPRESSION_BODY
CLASS_REFERENCE public final class A type=kotlin.reflect.KClass<A>
CLASS_REFERENCE A type=kotlin.reflect.KClass<A>
PROPERTY public val test2: kotlin.reflect.KClass<kotlin.Int>
EXPRESSION_BODY
GET_CLASS type=kotlin.reflect.KClass<kotlin.Int>
CALL .<get-qux> type=kotlin.Int operator=GET_PROPERTY
PROPERTY public val test3: kotlin.reflect.KFunction1<A, kotlin.Unit>
EXPRESSION_BODY
CALLABLE_REFERENCE public final fun foo(): kotlin.Unit type=kotlin.reflect.KFunction1<A, kotlin.Unit>
CALLABLE_REFERENCE foo type=kotlin.reflect.KFunction1<A, kotlin.Unit> operator=null
PROPERTY public val test4: kotlin.reflect.KFunction0<A>
EXPRESSION_BODY
CALLABLE_REFERENCE public constructor A() type=kotlin.reflect.KFunction0<A>
CALLABLE_REFERENCE <init> type=kotlin.reflect.KFunction0<A> operator=null
PROPERTY public val test5: kotlin.reflect.KFunction0<kotlin.Unit>
EXPRESSION_BODY
CALLABLE_REFERENCE public final fun foo(): kotlin.Unit type=kotlin.reflect.KFunction0<kotlin.Unit>
CALLABLE_REFERENCE foo type=kotlin.reflect.KFunction0<kotlin.Unit> operator=null
PROPERTY public val test6: kotlin.reflect.KFunction0<kotlin.Unit>
EXPRESSION_BODY
CALLABLE_REFERENCE public fun bar(): kotlin.Unit type=kotlin.reflect.KFunction0<kotlin.Unit>
CALLABLE_REFERENCE bar type=kotlin.reflect.KFunction0<kotlin.Unit> operator=null
PROPERTY public val test7: kotlin.reflect.KProperty0<kotlin.Int>
EXPRESSION_BODY
CALLABLE_REFERENCE public val qux: kotlin.Int = 42 type=kotlin.reflect.KProperty0<kotlin.Int>
CALLABLE_REFERENCE qux type=kotlin.reflect.KProperty0<kotlin.Int> operator=null
@@ -7,7 +7,7 @@ FILE /variableAsFunctionCall.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from=<anonymous>
$RECEIVER of: k type=kotlin.String
CALLABLE_REFERENCE local final fun <anonymous>(): kotlin.String type=() -> kotlin.String
CALLABLE_REFERENCE <anonymous> type=() -> kotlin.String operator=LAMBDA
FUN public fun test1(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
BLOCK_BODY
RETURN type=kotlin.Nothing from=test1
+1 -1
View File
@@ -5,4 +5,4 @@ FILE /anonymousFunction.kt
FUN local final fun <no name provided>(): kotlin.Unit
BLOCK_BODY
CALL .println type=kotlin.Unit operator=null
CALLABLE_REFERENCE local final fun <no name provided>(): kotlin.Unit type=() -> kotlin.Unit
CALLABLE_REFERENCE <no name provided> type=() -> kotlin.Unit operator=ANONYMOUS_FUNCTION
+1 -1
View File
@@ -10,4 +10,4 @@ FILE /extensionLambda.kt
RETURN type=kotlin.Nothing from=<anonymous>
CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
$this: $RECEIVER of: <anonymous> type=kotlin.String
CALLABLE_REFERENCE local final fun kotlin.String.<anonymous>(): kotlin.Int type=kotlin.String.() -> kotlin.Int
CALLABLE_REFERENCE <anonymous> type=kotlin.String.() -> kotlin.Int operator=LAMBDA
+1 -1
View File
@@ -6,4 +6,4 @@ FILE /justLambda.kt
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
CALLABLE_REFERENCE <anonymous> type=() -> kotlin.Int operator=LAMBDA
@@ -43,6 +43,6 @@ FILE /multipleImplicitReceivers.kt
$receiver: CALL .<get-foo> type=B operator=GET_PROPERTY
$this: $RECEIVER of: <anonymous> type=IFoo
$receiver: $RECEIVER of: <anonymous> type=A
CALLABLE_REFERENCE local final fun IInvoke.<anonymous>(): kotlin.Int type=IInvoke.() -> kotlin.Int
CALLABLE_REFERENCE local final fun IFoo.<anonymous>(): kotlin.Int type=IFoo.() -> kotlin.Int
CALLABLE_REFERENCE local final fun A.<anonymous>(): kotlin.Int type=A.() -> kotlin.Int
CALLABLE_REFERENCE <anonymous> type=IInvoke.() -> kotlin.Int operator=LAMBDA
CALLABLE_REFERENCE <anonymous> type=IFoo.() -> kotlin.Int operator=LAMBDA
CALLABLE_REFERENCE <anonymous> type=A.() -> kotlin.Int operator=LAMBDA
+5 -5
View File
@@ -6,7 +6,7 @@ FILE /nonLocalReturn.kt
FUN local final fun <anonymous>(): kotlin.Nothing
BLOCK_BODY
RETURN type=kotlin.Nothing from=test0
CALLABLE_REFERENCE local final fun <anonymous>(): kotlin.Nothing type=() -> kotlin.Nothing
CALLABLE_REFERENCE <anonymous> type=() -> kotlin.Nothing operator=LAMBDA
FUN public fun test1(): kotlin.Unit
BLOCK_BODY
CALL .run type=kotlin.Unit operator=null
@@ -14,7 +14,7 @@ FILE /nonLocalReturn.kt
FUN local final fun <anonymous>(): kotlin.Unit
BLOCK_BODY
RETURN type=kotlin.Nothing from=<anonymous>
CALLABLE_REFERENCE local final fun <anonymous>(): kotlin.Unit type=() -> kotlin.Unit
CALLABLE_REFERENCE <anonymous> type=() -> kotlin.Unit operator=LAMBDA
FUN public fun test2(): kotlin.Unit
BLOCK_BODY
CALL .run type=kotlin.Unit operator=null
@@ -22,7 +22,7 @@ FILE /nonLocalReturn.kt
FUN local final fun <anonymous>(): kotlin.Unit
BLOCK_BODY
RETURN type=kotlin.Nothing from=<anonymous>
CALLABLE_REFERENCE local final fun <anonymous>(): kotlin.Unit type=() -> kotlin.Unit
CALLABLE_REFERENCE <anonymous> type=() -> kotlin.Unit operator=LAMBDA
FUN public fun testLrmFoo1(/*0*/ ints: kotlin.collections.List<kotlin.Int>): kotlin.Unit
BLOCK_BODY
CALL .forEach type=kotlin.Unit operator=null
@@ -38,7 +38,7 @@ FILE /nonLocalReturn.kt
RETURN type=kotlin.Nothing from=<anonymous>
CALL .print type=kotlin.Unit operator=null
message: GET_VAR it type=kotlin.Int operator=null
CALLABLE_REFERENCE local final fun <anonymous>(/*0*/ it: kotlin.Int): kotlin.Unit type=(kotlin.Int) -> kotlin.Unit
CALLABLE_REFERENCE <anonymous> type=(kotlin.Int) -> kotlin.Unit operator=LAMBDA
FUN public fun testLrmFoo2(/*0*/ ints: kotlin.collections.List<kotlin.Int>): kotlin.Unit
BLOCK_BODY
CALL .forEach type=kotlin.Unit operator=null
@@ -54,4 +54,4 @@ FILE /nonLocalReturn.kt
RETURN type=kotlin.Nothing from=<anonymous>
CALL .print type=kotlin.Unit operator=null
message: GET_VAR it type=kotlin.Int operator=null
CALLABLE_REFERENCE local final fun <anonymous>(/*0*/ it: kotlin.Int): kotlin.Unit type=(kotlin.Int) -> kotlin.Unit
CALLABLE_REFERENCE <anonymous> type=(kotlin.Int) -> kotlin.Unit operator=LAMBDA