Generate InnerClasses attribute for nested classes in annotation arguments

Otherwise we incorrectly try to load a nested class "A.B" as if it is a
top level class named "A$B" and fail.

 #KT-38853 Fixed
This commit is contained in:
Alexander Udalov
2020-05-13 19:04:42 +02:00
parent cdac6157a9
commit ed8efafa9b
7 changed files with 145 additions and 4 deletions
@@ -3052,6 +3052,24 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/innerClasses")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class InnerClasses extends AbstractBytecodeTextTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInInnerClasses() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/innerClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@TestMetadata("nestedClassInAnnotationArgument.kt")
public void testNestedClassInAnnotationArgument() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/innerClasses/nestedClassInAnnotationArgument.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/interfaces")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)