FIR2IR: set proper IR origin for variable as function

This commit is contained in:
Jinseong Jeon
2020-09-11 13:10:26 -07:00
committed by Mikhail Glukhikh
parent bf3a7e5fea
commit 89ffce22d8
34 changed files with 112 additions and 202 deletions
@@ -13,13 +13,13 @@ FILE fqName:<root> fileName:/variableAsFunctionCall.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1 (f: kotlin.Function0<kotlin.Unit>): kotlin.Unit declared in <root>'
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE
$this: GET_VAR 'f: kotlin.Function0<kotlin.Unit> declared in <root>.test1' type=kotlin.Function0<kotlin.Unit> origin=null
$this: GET_VAR 'f: kotlin.Function0<kotlin.Unit> declared in <root>.test1' type=kotlin.Function0<kotlin.Unit> origin=VARIABLE_AS_FUNCTION
FUN name:test2 visibility:public modality:FINAL <> (f:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1<kotlin.String, kotlin.Unit>) returnType:kotlin.Unit
VALUE_PARAMETER name:f index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1<kotlin.String, kotlin.Unit>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2 (f: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1<kotlin.String, kotlin.Unit>): kotlin.Unit declared in <root>'
CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.Unit origin=INVOKE
$this: GET_VAR 'f: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1<kotlin.String, kotlin.Unit> declared in <root>.test2' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1<kotlin.String, kotlin.Unit> origin=null
$this: GET_VAR 'f: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1<kotlin.String, kotlin.Unit> declared in <root>.test2' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1<kotlin.String, kotlin.Unit> origin=VARIABLE_AS_FUNCTION
p1: CONST String type=kotlin.String value="hello"
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY