[FIR] Add // FIR_DUMP to some implicit invoke tests
Although these dumps don't really show if something is a `FirFunctionCall` or a `FirImplicitInvokeCall`, they do show what goes into the receiver, and what are value arguments.
This commit is contained in:
committed by
Space Team
parent
9b786d35f8
commit
3024ec3da3
+1
@@ -1,4 +1,5 @@
|
||||
// ISSUE: KT-64891
|
||||
// FIR_DUMP
|
||||
|
||||
fun <T> T.b(): Int = 10
|
||||
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
FILE: expressionsInQaSelectorsCornerCases.fir.kt
|
||||
public final fun <T> R|T|.b(): R|kotlin/Int| {
|
||||
^b Int(10)
|
||||
}
|
||||
public final fun <T> R|kotlin/Int|.a(it: R|T|): R|kotlin/Int| {
|
||||
^a this@R|/a|
|
||||
}
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
::<Unresolved reference: b>#.<Unresolved name: invoke>#(Int(5)).<Unresolved name: inv>#()
|
||||
::<Unresolved reference: a>#.<Unresolved name: invoke>#(Int(5), Char(=)).<Unresolved name: inv>#()
|
||||
lval c: R|@ExtensionFunctionType kotlin/reflect/KFunction1<kotlin/Int, kotlin/Int>| = Q|kotlin/Int|::R|/b<kotlin/Int>|
|
||||
R|<local>/c|.R|SubstitutionOverride<kotlin/reflect/KFunction1.invoke: R|kotlin/Int|>|(Int(5)).R|kotlin/Int.inv|()
|
||||
lval f: R|kotlin/Int.() -> kotlin/Int| = Q|kotlin/Int|::R|/b<kotlin/Int>|
|
||||
R|<local>/f|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Int|>|(Int(5)).R|kotlin/Int.inv|()
|
||||
Q|kotlin/Int|::R|/b<kotlin/Int>|.R|SubstitutionOverride<kotlin/reflect/KFunction1.invoke: R|kotlin/Int|>|(Int(5)).R|kotlin/Int.inv|()
|
||||
lval d: R|@ExtensionFunctionType kotlin/reflect/KFunction2<kotlin/Int, ERROR CLASS: Cannot infer argument for type parameter T, kotlin/Int>| = Q|kotlin/Int|::R|/a<CS errors: _synthetic/ACCEPT_SPECIFIC_TYPE_CALL>#|
|
||||
R|<local>/d|.R|SubstitutionOverride<kotlin/reflect/KFunction2.invoke: R|kotlin/Int|>|(Int(5), Char(=)).R|kotlin/Int.inv|()
|
||||
lval e: R|kotlin/Int.(kotlin/Char) -> kotlin/Int| = Q|kotlin/Int|::R|/a<kotlin/Char>|
|
||||
R|<local>/e|.R|SubstitutionOverride<kotlin/Function2.invoke: R|kotlin/Int|>|(Int(5), Char(=)).R|kotlin/Int.inv|()
|
||||
}
|
||||
public final val <T> R|T|.x: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(10)
|
||||
}
|
||||
public final fun rain(): R|kotlin/Unit| {
|
||||
<Unresolved name: x>#.<Unresolved name: invoke>#(Int(5)).<Unresolved name: inv>#()
|
||||
::<Unresolved reference: x>#.<Unresolved name: invoke>#(Int(5)).<Unresolved name: inv>#()
|
||||
Q|kotlin/Int|::R|/x<kotlin/Int>|.R|SubstitutionOverride<kotlin/reflect/KProperty1.invoke: R|kotlin/Int|><Inapplicable(INAPPLICABLE): kotlin/reflect/KProperty1.invoke>#|(Int(5)).R|kotlin/Int.inv|()
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
// ISSUE: KT-64891
|
||||
// FIR_DUMP
|
||||
|
||||
fun <T> T.b(): Int = 10
|
||||
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// ISSUE: KT-64891
|
||||
// FIR_DUMP
|
||||
|
||||
fun test(f: (Int) -> Int) {
|
||||
<!NO_RECEIVER_ALLOWED!>2.(f)()<!>
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
FILE: expressionsInQaSelectorsReceiverConversion.fir.kt
|
||||
public final fun test(f: R|(kotlin/Int) -> kotlin/Int|): R|kotlin/Unit| {
|
||||
R|<local>/f|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Int|><Inapplicable(INAPPLICABLE): kotlin/Function1.invoke>#|(Int(2))
|
||||
}
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
// ISSUE: KT-64891
|
||||
// FIR_DUMP
|
||||
|
||||
fun test(f: (Int) -> Int) {
|
||||
2.<!NO_RECEIVER_ALLOWED!>(f)<!>()
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
FILE: expressionsInQaSelectorsWithElvis.kt
|
||||
public final fun test(a: R|(kotlin/Int.() -> kotlin/Int)?|, b: R|kotlin/Int.() -> kotlin/Int|): R|kotlin/Unit| {
|
||||
R|<local>/a| ?: R|<local>/b|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Int|>|(Int(2))
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-64891
|
||||
// FIR_DUMP
|
||||
|
||||
fun test(a: (Int.() -> Int)?, b: Int.() -> Int) {
|
||||
2.(a ?: b)()
|
||||
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_DUMP
|
||||
|
||||
fun test1(f: String.() -> Unit) {
|
||||
(f)<!NO_VALUE_FOR_PARAMETER!>()<!>
|
||||
|
||||
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
FILE: receiverPresenceErrorForInvoke.fir.kt
|
||||
public final fun test1(f: R|kotlin/String.() -> kotlin/Unit|): R|kotlin/Unit| {
|
||||
R|<local>/f|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|><Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): kotlin/Function1.invoke>#|()
|
||||
R|<local>/f|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|><Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): kotlin/Function1.invoke>#|()
|
||||
}
|
||||
public final fun test2(f: R|(kotlin/Int) -> kotlin/Int|): R|kotlin/Unit| {
|
||||
IntegerLiteral(1).<Unresolved name: f>#(Int(2))
|
||||
R|<local>/f|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Int|><Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): kotlin/Function1.invoke>#|(Int(2), Int(2))
|
||||
}
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_DUMP
|
||||
|
||||
fun test1(f: String.() -> Unit) {
|
||||
(f)<!NO_VALUE_FOR_PARAMETER!>()<!>
|
||||
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_DUMP
|
||||
|
||||
fun test1() {
|
||||
1. <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>(fun String.(i: Int) = i )<!>(1)
|
||||
|
||||
compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverForInvokeOnExpression.fir.txt
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
FILE: wrongReceiverForInvokeOnExpression.fir.kt
|
||||
public final fun test1(): R|kotlin/Unit| {
|
||||
fun R|kotlin/String|.<anonymous>(i: R|kotlin/Int|): R|kotlin/Int| <inline=Unknown> {
|
||||
^ R|<local>/i|
|
||||
}
|
||||
.R|SubstitutionOverride<kotlin/Function2.invoke: R|kotlin/Int|><None of the following candidates is applicable because of receiver type mismatch: [kotlin/Function2.invoke]>#|(Int(1), Int(1))
|
||||
label@fun R|kotlin/String|.<anonymous>(i: R|kotlin/Int|): R|kotlin/Int| <inline=Unknown> {
|
||||
^@label R|<local>/i|
|
||||
}
|
||||
.R|SubstitutionOverride<kotlin/Function2.invoke: R|kotlin/Int|><None of the following candidates is applicable because of receiver type mismatch: [kotlin/Function2.invoke]>#|(Int(1), Int(1))
|
||||
}
|
||||
public final fun test2(f: R|kotlin/String.(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit| {
|
||||
R|<local>/f|.R|SubstitutionOverride<kotlin/Function2.invoke: R|kotlin/Unit|><None of the following candidates is applicable because of receiver type mismatch: [kotlin/Function2.invoke]>#|(Int(11), Int(1))
|
||||
R|<local>/f|.R|SubstitutionOverride<kotlin/Function2.invoke: R|kotlin/Unit|><Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): kotlin/Function2.invoke>#|(Int(11))
|
||||
}
|
||||
public final fun test3(): R|kotlin/Unit| {
|
||||
local final fun foo(): R|kotlin/String.(kotlin/Int) -> kotlin/Unit| {
|
||||
^foo fun R|kotlin/String|.<anonymous>(it: R|kotlin/Int|): R|kotlin/Unit| <inline=Unknown> {
|
||||
^ Unit
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
R|<local>/foo|().R|SubstitutionOverride<kotlin/Function2.invoke: R|kotlin/Unit|><None of the following candidates is applicable because of receiver type mismatch: [kotlin/Function2.invoke]>#|(Int(1), Int(1))
|
||||
}
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
// FIR_DUMP
|
||||
|
||||
fun test1() {
|
||||
1. <!FUNCTION_EXPECTED!>(fun String.(i: Int) = i )<!>(1)
|
||||
1.<!FUNCTION_EXPECTED!>(label@ fun String.(i: Int) = i )<!>(1)
|
||||
|
||||
Reference in New Issue
Block a user