K2: add test for KT-56954
This commit is contained in:
committed by
Space Team
parent
f946ddeb40
commit
7a6ff5de34
+6
@@ -6291,6 +6291,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/IntersectionWithJavaString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaForKfunction.kt")
|
||||
public void testLambdaForKfunction() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/lambdaForKfunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ParentOfType.kt")
|
||||
public void testParentOfType() throws Exception {
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
FILE: lambdaForKfunction.kt
|
||||
public final fun foo(arg: R|kotlin/reflect/KFunction0<kotlin/Unit>|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
R|/foo|(fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
|
||||
}
|
||||
)
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// WITH_REFLECT
|
||||
|
||||
import kotlin.reflect.KFunction0
|
||||
|
||||
fun foo(arg: KFunction0<Unit>) {}
|
||||
|
||||
fun main() {
|
||||
foo(fun() {}) // K1: TYPE_MISMATCH, K2: ok in compile-time & CCE at run-time
|
||||
}
|
||||
+6
@@ -6291,6 +6291,12 @@ public class FirLightTreeDiagnosticsTestGenerated extends AbstractFirLightTreeDi
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/IntersectionWithJavaString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaForKfunction.kt")
|
||||
public void testLambdaForKfunction() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/lambdaForKfunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ParentOfType.kt")
|
||||
public void testParentOfType() throws Exception {
|
||||
|
||||
+6
@@ -6291,6 +6291,12 @@ public class FirPsiDiagnosticTestGenerated extends AbstractFirPsiDiagnosticTest
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/IntersectionWithJavaString.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lambdaForKfunction.kt")
|
||||
public void testLambdaForKfunction() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/lambdaForKfunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ParentOfType.kt")
|
||||
public void testParentOfType() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user