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:
@@ -26,7 +26,7 @@ fun <T> fooT2() : (t : T) -> T {
|
||||
fun main(args : Array<String>) {
|
||||
args.foo()()
|
||||
<!INAPPLICABLE_CANDIDATE!>args.foo1()()<!>
|
||||
<!UNRESOLVED_REFERENCE!>a<!>.foo1()()
|
||||
<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>a<!>.foo1()()
|
||||
<!UNRESOLVED_REFERENCE!>a<!>.foo1()(<!UNRESOLVED_REFERENCE!>a<!>)
|
||||
|
||||
args.foo1()(1)
|
||||
|
||||
+17
-17
@@ -35,37 +35,37 @@ fun test() {
|
||||
foo {
|
||||
bar {
|
||||
baz {
|
||||
<!INAPPLICABLE_CANDIDATE!>y<!>()
|
||||
y()
|
||||
|
||||
<!UNRESOLVED_REFERENCE!>x<!>()
|
||||
|
||||
with(D()) {
|
||||
<!INAPPLICABLE_CANDIDATE!>x<!>()
|
||||
x()
|
||||
}
|
||||
|
||||
foo1 {
|
||||
<!INAPPLICABLE_CANDIDATE!>x<!>()
|
||||
<!INAPPLICABLE_CANDIDATE!>y<!>()
|
||||
x()
|
||||
y()
|
||||
|
||||
with(A()) {
|
||||
<!INAPPLICABLE_CANDIDATE!>x<!>()
|
||||
<!INAPPLICABLE_CANDIDATE!>y<!>()
|
||||
x()
|
||||
y()
|
||||
}
|
||||
|
||||
with(D()) {
|
||||
<!INAPPLICABLE_CANDIDATE!>x<!>()
|
||||
x()
|
||||
}
|
||||
A().<!UNRESOLVED_REFERENCE!>x<!>()
|
||||
}
|
||||
|
||||
foo2 {
|
||||
<!INAPPLICABLE_CANDIDATE!>x<!>()
|
||||
<!INAPPLICABLE_CANDIDATE!>y<!>()
|
||||
x()
|
||||
y()
|
||||
}
|
||||
|
||||
foo3 {
|
||||
<!INAPPLICABLE_CANDIDATE!>x<!>()
|
||||
<!INAPPLICABLE_CANDIDATE!>y<!>()
|
||||
x()
|
||||
y()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,8 +75,8 @@ fun test() {
|
||||
foo {
|
||||
baz {
|
||||
bar {
|
||||
<!INAPPLICABLE_CANDIDATE!>x<!>()
|
||||
<!INAPPLICABLE_CANDIDATE!>y<!>()
|
||||
x()
|
||||
y()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,8 +86,8 @@ fun test() {
|
||||
foo {
|
||||
baz {
|
||||
bar {
|
||||
<!INAPPLICABLE_CANDIDATE!>x<!>()
|
||||
<!INAPPLICABLE_CANDIDATE!>y<!>()
|
||||
x()
|
||||
y()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,8 +97,8 @@ fun test() {
|
||||
foo {
|
||||
baz {
|
||||
bar {
|
||||
<!INAPPLICABLE_CANDIDATE!>x<!>()
|
||||
<!INAPPLICABLE_CANDIDATE!>y<!>()
|
||||
x()
|
||||
y()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+5
-5
@@ -24,10 +24,10 @@ fun test(a: A, b: B) {
|
||||
}
|
||||
|
||||
with(b) {
|
||||
a.<!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
a.(<!INAPPLICABLE_CANDIDATE!>foo<!>)()
|
||||
a.foo()
|
||||
a.(foo)()
|
||||
|
||||
<!INAPPLICABLE_CANDIDATE!>(a.foo)()<!>
|
||||
(a.foo)()
|
||||
|
||||
(a.foo)(this)
|
||||
a.foo(this)
|
||||
@@ -35,8 +35,8 @@ fun test(a: A, b: B) {
|
||||
|
||||
with(a) {
|
||||
with(b) {
|
||||
<!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
(<!INAPPLICABLE_CANDIDATE!>foo<!>)()
|
||||
foo()
|
||||
(foo)()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>'
|
||||
|
||||
Reference in New Issue
Block a user