Regenerate tests after rebase on master, add FIR tests
This commit is contained in:
-24076
File diff suppressed because it is too large
Load Diff
Generated
+48
@@ -7872,6 +7872,54 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/funInterface")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class FunInterface extends AbstractFirOldFrontendDiagnosticsTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFunInterface() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/funInterface"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("basicFunInterface.kt")
|
||||
public void testBasicFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/basicFunInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("basicFunInterfaceConversion.kt")
|
||||
public void testBasicFunInterfaceConversion() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceConversion.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("basicFunInterfaceDisabled.kt")
|
||||
public void testBasicFunInterfaceDisabled() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceDisabled.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("funInterfaceSyntheticConstructors.kt")
|
||||
public void testFunInterfaceSyntheticConstructors() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericSubstitutionForFunInterface.kt")
|
||||
public void testGenericSubstitutionForFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("severalConversionsForFunInterface.kt")
|
||||
public void testSeveralConversionsForFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/severalConversionsForFunInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("suspendFunInterfaceConversion.kt")
|
||||
public void testSuspendFunInterfaceConversion() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/functionAsExpression")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// !LANGUAGE: +FunctionalInterfaceConversion
|
||||
|
||||
fun interface Foo {
|
||||
fun invoke()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun interface Foo {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
fun foo(f: Foo) {}
|
||||
|
||||
fun test() {
|
||||
foo {}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// !LANGUAGE: -FunctionalInterfaceConversion
|
||||
|
||||
fun interface Foo {
|
||||
fun invoke()
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun interface KRunnable {
|
||||
fun invoke()
|
||||
}
|
||||
|
||||
typealias KRunnableAlias = KRunnable
|
||||
|
||||
fun foo(f: KRunnable) {}
|
||||
|
||||
fun test() {
|
||||
foo(KRunnable {})
|
||||
foo(KRunnableAlias {})
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion
|
||||
// !CHECK_TYPE
|
||||
|
||||
fun interface F<S> {
|
||||
fun apply(s: S)
|
||||
}
|
||||
|
||||
interface PR<X, Y> {}
|
||||
|
||||
interface K<T> {
|
||||
fun f_t(f1: F<T>, f2: F<T>)
|
||||
fun <R> f_r(f1: F<R>, f2: F<R>)
|
||||
fun <R> f_pr(f1: F<PR<T, R>>, f2: F<PR<T, R>>)
|
||||
}
|
||||
|
||||
fun test(
|
||||
k: K<String>,
|
||||
f_string: F<String>,
|
||||
f_int: F<Int>,
|
||||
f_pr: F<PR<String, Int>>
|
||||
) {
|
||||
k.f_t(f_string) { it checkType { _<String>() } }
|
||||
k.f_r(f_int) { it checkType { _<Int>() } }
|
||||
k.f_pr(f_pr) { it checkType { _<PR<String, Int>>() } }
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion
|
||||
|
||||
interface J {
|
||||
fun foo1(r: KRunnable)
|
||||
|
||||
fun foo2(r1: KRunnable, r2: KRunnable)
|
||||
|
||||
fun foo3(r1: KRunnable, r2: KRunnable, r3: KRunnable)
|
||||
}
|
||||
|
||||
fun interface KRunnable {
|
||||
fun run()
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
fun test(j: J, r: KRunnable) {
|
||||
j.foo1(r)
|
||||
j.foo1({})
|
||||
|
||||
j.foo2(r, r)
|
||||
j.foo2({}, {})
|
||||
j.foo2(r, {})
|
||||
j.foo2({}, r)
|
||||
|
||||
j.foo3(r, r, r)
|
||||
j.foo3(r, r, {})
|
||||
j.foo3(r, {}, r)
|
||||
j.foo3(r, {}, {})
|
||||
j.foo3({}, r, r)
|
||||
j.foo3({}, r, {})
|
||||
j.foo3({}, {}, r)
|
||||
j.foo3({}, {}, {})
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -NOTHING_TO_INLINE
|
||||
|
||||
fun interface SuspendRunnable {
|
||||
suspend fun invoke()
|
||||
}
|
||||
|
||||
fun run(r: SuspendRunnable) {}
|
||||
|
||||
suspend fun bar() {}
|
||||
|
||||
fun test() {
|
||||
run(::bar)
|
||||
}
|
||||
+1
-1
@@ -7888,7 +7888,7 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFunInterface() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/funInterface"), Pattern.compile("^(.*)\\.kts?$"), true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/funInterface"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("basicFunInterface.kt")
|
||||
|
||||
Generated
+1
-1
@@ -7883,7 +7883,7 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFunInterface() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/funInterface"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/funInterface"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("basicFunInterface.kt")
|
||||
|
||||
+1
-1
@@ -11619,7 +11619,7 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFunInterface() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/funInterface"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/funInterface"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("basicFunInterface.kt")
|
||||
|
||||
+1
-1
@@ -11619,7 +11619,7 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFunInterface() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/funInterface"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/funInterface"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("basicFunInterface.kt")
|
||||
|
||||
+1
-1
@@ -10469,7 +10469,7 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFunInterface() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/funInterface"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/funInterface"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("basicFunInterface.kt")
|
||||
|
||||
+1
-1
@@ -10469,7 +10469,7 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFunInterface() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/funInterface"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/funInterface"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("basicFunInterface.kt")
|
||||
|
||||
Generated
+13
@@ -8990,6 +8990,19 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/funInterface")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class FunInterface extends AbstractIrJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFunInterface() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/funInterface"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/functions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+13
@@ -10065,6 +10065,19 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/funInterface")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class FunInterface extends AbstractJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFunInterface() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/funInterface"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/functions")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user