Support class literals (A::class)

This commit is contained in:
Alexander Udalov
2015-03-05 22:01:50 +03:00
parent 2b089e0f39
commit 6e45c6f17c
22 changed files with 316 additions and 39 deletions
@@ -33,6 +33,7 @@ import java.util.regex.Pattern;
@InnerTestClasses({
JetDiagnosticsTestWithStdLibGenerated.Annotations.class,
JetDiagnosticsTestWithStdLibGenerated.CallableReference.class,
JetDiagnosticsTestWithStdLibGenerated.ClassLiteral.class,
JetDiagnosticsTestWithStdLibGenerated.DuplicateJvmSignature.class,
JetDiagnosticsTestWithStdLibGenerated.FunctionLiterals.class,
JetDiagnosticsTestWithStdLibGenerated.Inference.class,
@@ -598,6 +599,21 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/classLiteral")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ClassLiteral extends AbstractJetDiagnosticsTestWithStdLib {
public void testAllFilesPresentInClassLiteral() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/classLiteral"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("simpleClassLiteral.kt")
public void testSimpleClassLiteral() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/classLiteral/simpleClassLiteral.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -2524,6 +2524,7 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
@TestMetadata("compiler/testData/codegen/boxWithStdlib/reflection")
@TestDataPath("$PROJECT_ROOT")
@InnerTestClasses({
Reflection.ClassLiterals.class,
Reflection.Enclosing.class,
Reflection.GenericSignature.class,
Reflection.Mapping.class,
@@ -2536,6 +2537,21 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithStdlib/reflection"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("compiler/testData/codegen/boxWithStdlib/reflection/classLiterals")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ClassLiterals extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInClassLiterals() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithStdlib/reflection/classLiterals"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("simpleClassLiteral.kt")
public void testSimpleClassLiteral() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/classLiterals/simpleClassLiteral.kt");
doTestWithStdlib(fileName);
}
}
@TestMetadata("compiler/testData/codegen/boxWithStdlib/reflection/enclosing")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -2712,6 +2728,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
doTestWithStdlib(fileName);
}
@TestMetadata("mappedClassIsEqualToClassLiteral.kt")
public void testMappedClassIsEqualToClassLiteral() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/mapping/mappedClassIsEqualToClassLiteral.kt");
doTestWithStdlib(fileName);
}
@TestMetadata("memberProperty.kt")
public void testMemberProperty() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/mapping/memberProperty.kt");