Support Array::class literal, forbid Array<X>::class on non-JVM

#KT-31230 Fixed
This commit is contained in:
Alexander Udalov
2019-05-02 18:34:20 +02:00
parent 8103f0ba60
commit f38e4d618e
15 changed files with 156 additions and 13 deletions
@@ -59,6 +59,29 @@ public class DiagnosticsTestWithJsStdLibGenerated extends AbstractDiagnosticsTes
runTest("compiler/testData/diagnostics/testsWithJsStdLib/wrongMultipleInheritance.kt");
}
@TestMetadata("compiler/testData/diagnostics/testsWithJsStdLib/classLiteral")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ClassLiteral extends AbstractDiagnosticsTestWithJsStdLib {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInClassLiteral() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLib/classLiteral"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("arrays_after.kt")
public void testArrays_after() throws Exception {
runTest("compiler/testData/diagnostics/testsWithJsStdLib/classLiteral/arrays_after.kt");
}
@TestMetadata("arrays_before.kt")
public void testArrays_before() throws Exception {
runTest("compiler/testData/diagnostics/testsWithJsStdLib/classLiteral/arrays_before.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -2956,6 +2956,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/classLiteral"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("bareArray.kt")
public void testBareArray() throws Exception {
runTest("compiler/testData/codegen/box/classLiteral/bareArray.kt");
}
@TestMetadata("primitiveKClassEquality.kt")
public void testPrimitiveKClassEquality() throws Exception {
runTest("compiler/testData/codegen/box/classLiteral/primitiveKClassEquality.kt");
@@ -20612,6 +20617,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/reflection/classLiterals/arrays.kt");
}
@TestMetadata("bareArray.kt")
public void testBareArray() throws Exception {
runTest("compiler/testData/codegen/box/reflection/classLiterals/bareArray.kt");
}
@TestMetadata("builtinClassLiterals.kt")
public void testBuiltinClassLiterals() throws Exception {
runTest("compiler/testData/codegen/box/reflection/classLiterals/builtinClassLiterals.kt");
@@ -2956,6 +2956,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/classLiteral"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("bareArray.kt")
public void testBareArray() throws Exception {
runTest("compiler/testData/codegen/box/classLiteral/bareArray.kt");
}
@TestMetadata("primitiveKClassEquality.kt")
public void testPrimitiveKClassEquality() throws Exception {
runTest("compiler/testData/codegen/box/classLiteral/primitiveKClassEquality.kt");
@@ -20612,6 +20617,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/reflection/classLiterals/arrays.kt");
}
@TestMetadata("bareArray.kt")
public void testBareArray() throws Exception {
runTest("compiler/testData/codegen/box/reflection/classLiterals/bareArray.kt");
}
@TestMetadata("builtinClassLiterals.kt")
public void testBuiltinClassLiterals() throws Exception {
runTest("compiler/testData/codegen/box/reflection/classLiterals/builtinClassLiterals.kt");
@@ -2936,6 +2936,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/classLiteral"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
}
@TestMetadata("bareArray.kt")
public void testBareArray() throws Exception {
runTest("compiler/testData/codegen/box/classLiteral/bareArray.kt");
}
@TestMetadata("primitiveKClassEquality.kt")
public void testPrimitiveKClassEquality() throws Exception {
runTest("compiler/testData/codegen/box/classLiteral/primitiveKClassEquality.kt");
@@ -19502,6 +19507,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/reflection/classLiterals/arrays.kt");
}
@TestMetadata("bareArray.kt")
public void testBareArray() throws Exception {
runTest("compiler/testData/codegen/box/reflection/classLiterals/bareArray.kt");
}
@TestMetadata("builtinClassLiterals.kt")
public void testBuiltinClassLiterals() throws Exception {
runTest("compiler/testData/codegen/box/reflection/classLiterals/builtinClassLiterals.kt");