[FIR TEST] Add test with incorrect invoke receiver
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fun String.invoke() = this
|
||||||
|
|
||||||
|
val some = ""
|
||||||
|
fun sss() {
|
||||||
|
val some = 10
|
||||||
|
|
||||||
|
<!INAPPLICABLE_CANDIDATE!>some<!>() // Should be inapplicable
|
||||||
|
}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
FILE: incorrectInvokeReceiver.kt
|
||||||
|
public final fun R|kotlin/String|.invoke(): R|kotlin/String| {
|
||||||
|
^invoke this@R|/invoke|
|
||||||
|
}
|
||||||
|
public final val some: R|kotlin/String| = String()
|
||||||
|
public get(): R|kotlin/String|
|
||||||
|
public final fun sss(): R|kotlin/Unit| {
|
||||||
|
lval some: R|kotlin/Int| = Int(10)
|
||||||
|
<Inapplicable(WRONG_RECEIVER): [/invoke]>#()
|
||||||
|
}
|
||||||
+5
@@ -684,6 +684,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
|||||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/inBrackets.kt");
|
runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/inBrackets.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("incorrectInvokeReceiver.kt")
|
||||||
|
public void testIncorrectInvokeReceiver() throws Exception {
|
||||||
|
runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/incorrectInvokeReceiver.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("propertyFromParameter.kt")
|
@TestMetadata("propertyFromParameter.kt")
|
||||||
public void testPropertyFromParameter() throws Exception {
|
public void testPropertyFromParameter() throws Exception {
|
||||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/propertyFromParameter.kt");
|
runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/propertyFromParameter.kt");
|
||||||
|
|||||||
Generated
+5
@@ -684,6 +684,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
|||||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/inBrackets.kt");
|
runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/inBrackets.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("incorrectInvokeReceiver.kt")
|
||||||
|
public void testIncorrectInvokeReceiver() throws Exception {
|
||||||
|
runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/incorrectInvokeReceiver.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("propertyFromParameter.kt")
|
@TestMetadata("propertyFromParameter.kt")
|
||||||
public void testPropertyFromParameter() throws Exception {
|
public void testPropertyFromParameter() throws Exception {
|
||||||
runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/propertyFromParameter.kt");
|
runTest("compiler/fir/resolve/testData/resolve/expresssions/invoke/propertyFromParameter.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user