FIR resolve: introduce builtInExtensionFunctionReceiverValue

This commit allows us to distinguish extension lambda receivers
from simple extension receivers thus fixing some resolve problems.
This commit is contained in:
Mikhail Glukhikh
2019-12-26 13:38:04 +03:00
parent de50f8aef3
commit 0c88ecdc56
20 changed files with 144 additions and 101 deletions
@@ -14,3 +14,4 @@ FILE fqName:<root> fileName:/extFunInvokeAsFun.kt
RETURN type=kotlin.Nothing from='public final fun with2 (receiver: kotlin.Any?, block: kotlin.Function1<kotlin.Any?, kotlin.Unit>): kotlin.Unit declared in <root>'
CALL 'public abstract fun invoke (p1: kotlin.Any?): kotlin.Unit [operator] declared in kotlin.Function1' type=kotlin.Unit origin=null
$this: GET_VAR 'block: kotlin.Function1<kotlin.Any?, kotlin.Unit> declared in <root>.with2' type=kotlin.Function1<kotlin.Any?, kotlin.Unit> origin=null
p1: GET_VAR 'receiver: kotlin.Any? declared in <root>.with2' type=kotlin.Any? origin=null
@@ -6,5 +6,6 @@ FILE fqName:<root> fileName:/extFunSafeInvoke.kt
RETURN type=kotlin.Nothing from='public final fun test (receiver: kotlin.Any?, fn: kotlin.Function3<kotlin.Any, kotlin.Int, kotlin.String, kotlin.Unit>): kotlin.Unit? declared in <root>'
CALL 'public abstract fun invoke (p1: kotlin.Any, p2: kotlin.Int, p3: kotlin.String): kotlin.Unit [operator] declared in kotlin.Function3' type=kotlin.Unit? origin=null
$this: GET_VAR 'fn: kotlin.Function3<kotlin.Any, kotlin.Int, kotlin.String, kotlin.Unit> declared in <root>.test' type=kotlin.Function3<kotlin.Any, kotlin.Int, kotlin.String, kotlin.Unit> origin=null
p1: CONST Int type=kotlin.Int value=42
p2: CONST String type=kotlin.String value="Hello"
p1: GET_VAR 'receiver: kotlin.Any? declared in <root>.test' type=kotlin.Any? origin=null
p2: CONST Int type=kotlin.Int value=42
p3: CONST String type=kotlin.String value="Hello"
@@ -19,6 +19,7 @@ FILE fqName:<root> fileName:/variableAsFunctionCall.kt
RETURN type=kotlin.Nothing from='public final fun test2 (f: kotlin.Function1<kotlin.String, kotlin.Unit>): kotlin.Unit declared in <root>'
CALL 'public abstract fun invoke (p1: kotlin.String): kotlin.Unit [operator] declared in kotlin.Function1' type=kotlin.Unit origin=null
$this: GET_VAR 'f: kotlin.Function1<kotlin.String, kotlin.Unit> declared in <root>.test2' type=kotlin.Function1<kotlin.String, kotlin.Unit> origin=null
p1: CONST String type=kotlin.String value="hello"
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.String declared in <root>'