KT-61032 [FIR] Add testData for invoke on K*Function* local variables
N.B. Method references currently also implicitly have such type
This commit is contained in:
committed by
Space Team
parent
6951efe63c
commit
2c90f1327d
+18
@@ -3152,6 +3152,24 @@ public class DiagnosticCompilerTestFirTestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invoke.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKFunction.kt")
|
||||
public void testInvokeKFunction() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKFunctionFromMethodReference.kt")
|
||||
public void testInvokeKFunctionFromMethodReference() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKFunctionFromMethodReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKSuspendFunction.kt")
|
||||
public void testInvokeKSuspendFunction() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKSuspendFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambda.kt")
|
||||
public void testLambda() throws Exception {
|
||||
|
||||
+18
@@ -3152,6 +3152,24 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invoke.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKFunction.kt")
|
||||
public void testInvokeKFunction() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKFunctionFromMethodReference.kt")
|
||||
public void testInvokeKFunctionFromMethodReference() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKFunctionFromMethodReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKSuspendFunction.kt")
|
||||
public void testInvokeKSuspendFunction() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKSuspendFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambda.kt")
|
||||
public void testLambda() throws Exception {
|
||||
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
FILE: invokeKFunction.kt
|
||||
public final fun foo(action: R|kotlin/reflect/KFunction1<kotlin/String, kotlin/Int>|): R|kotlin/Int| {
|
||||
lval localAction: R|kotlin/reflect/KFunction1<kotlin/String, kotlin/Int>| = R|<local>/action|
|
||||
^foo R|<local>/localAction|.R|SubstitutionOverride<kotlin/reflect/KFunction1.invoke: R|kotlin/Int|>|(String(hello))
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// WITH_STDLIB
|
||||
import kotlin.reflect.KFunction1
|
||||
|
||||
fun foo(action: KFunction1<String, Int>): Int {
|
||||
val <!UNUSED_VARIABLE!>localAction<!> = action
|
||||
|
||||
return localAction("hello")
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
FILE: invokeKFunctionFromMethodReference.kt
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
local final fun action(s: R|kotlin/String|): R|kotlin/Int| {
|
||||
^action R|<local>/s|.R|kotlin/text/toInt|()
|
||||
}
|
||||
|
||||
lval localAction: R|kotlin/reflect/KFunction1<kotlin/String, kotlin/Int>| = ::R|<local>/action|
|
||||
^foo R|<local>/localAction|.R|SubstitutionOverride<kotlin/reflect/KFunction1.invoke: R|kotlin/Int|>|(String(hello))
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// WITH_STDLIB
|
||||
fun foo(): Int {
|
||||
fun action(s: String): Int = s.toInt()
|
||||
|
||||
val <!UNUSED_VARIABLE!>localAction<!> = ::action
|
||||
|
||||
return localAction("hello")
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
FILE: invokeKSuspendFunction.kt
|
||||
public final suspend fun foo(action: R|kotlin/reflect/KSuspendFunction1<kotlin/String, kotlin/Int>|): R|kotlin/Int| {
|
||||
lval localAction: R|kotlin/reflect/KSuspendFunction1<kotlin/String, kotlin/Int>| = R|<local>/action|
|
||||
^foo R|<local>/localAction|.R|SubstitutionOverride<kotlin/reflect/KSuspendFunction1.invoke: R|kotlin/Int|>|(String(hello))
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// WITH_STDLIB
|
||||
import kotlin.reflect.KSuspendFunction1
|
||||
|
||||
suspend fun foo(action: KSuspendFunction1<String, Int>): Int {
|
||||
val <!UNUSED_VARIABLE!>localAction<!> = action
|
||||
|
||||
return localAction("hello")
|
||||
}
|
||||
+18
@@ -3152,6 +3152,24 @@ public class FirLightTreeDiagnosticsTestGenerated extends AbstractFirLightTreeDi
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invoke.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKFunction.kt")
|
||||
public void testInvokeKFunction() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKFunctionFromMethodReference.kt")
|
||||
public void testInvokeKFunctionFromMethodReference() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKFunctionFromMethodReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKSuspendFunction.kt")
|
||||
public void testInvokeKSuspendFunction() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKSuspendFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambda.kt")
|
||||
public void testLambda() throws Exception {
|
||||
|
||||
+18
@@ -3152,6 +3152,24 @@ public class FirPsiDiagnosticTestGenerated extends AbstractFirPsiDiagnosticTest
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invoke.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKFunction.kt")
|
||||
public void testInvokeKFunction() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKFunctionFromMethodReference.kt")
|
||||
public void testInvokeKFunctionFromMethodReference() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKFunctionFromMethodReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("invokeKSuspendFunction.kt")
|
||||
public void testInvokeKSuspendFunction() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invokeKSuspendFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambda.kt")
|
||||
public void testLambda() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user