Load annotations on constructors and parameters of Kotlin reflected classes

This commit is contained in:
Alexander Udalov
2015-03-02 13:33:38 +03:00
parent 4fb420f3f1
commit 1054f004aa
8 changed files with 111 additions and 11 deletions
@@ -0,0 +1,6 @@
//ALLOW_AST_ACCESS
package test
annotation class Anno(val value: String)
class Constructor [Anno(value = "string")]()
@@ -0,0 +1,11 @@
package test
internal final annotation class Anno : kotlin.Annotation {
/*primary*/ public constructor Anno(/*0*/ value: kotlin.String)
internal final val value: kotlin.String
internal final fun <get-value>(): kotlin.String
}
internal final class Constructor {
/*primary*/ test.Anno(value = "string": kotlin.String) public constructor Constructor()
}
@@ -0,0 +1,10 @@
//ALLOW_AST_ACCESS
package test
annotation class A(val s: String)
class Outer {
class Nested([A("nested")] val x: String)
inner class Inner([A("inner")] val y: String)
}
@@ -0,0 +1,23 @@
package test
internal final annotation class A : kotlin.Annotation {
/*primary*/ public constructor A(/*0*/ s: kotlin.String)
internal final val s: kotlin.String
internal final fun <get-s>(): kotlin.String
}
internal final class Outer {
/*primary*/ public constructor Outer()
internal final inner class Inner {
/*primary*/ public constructor Inner(/*0*/ test.A(s = "inner": kotlin.String) y: kotlin.String)
test.A(s = "inner": kotlin.String) internal final val y: kotlin.String
internal final fun <get-y>(): kotlin.String
}
internal final class Nested {
/*primary*/ public constructor Nested(/*0*/ test.A(s = "nested": kotlin.String) x: kotlin.String)
test.A(s = "nested": kotlin.String) internal final val x: kotlin.String
internal final fun <get-x>(): kotlin.String
}
}
@@ -1939,6 +1939,12 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
doTestCompiledKotlin(fileName);
}
@TestMetadata("Constructor.kt")
public void testConstructor() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/Constructor.kt");
doTestCompiledKotlin(fileName);
}
@TestMetadata("DelegatedProperty.kt")
public void testDelegatedProperty() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/DelegatedProperty.kt");
@@ -2176,6 +2182,12 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
doTestCompiledKotlin(fileName);
}
@TestMetadata("InnerClassConstructor.kt")
public void testInnerClassConstructor() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/parameters/InnerClassConstructor.kt");
doTestCompiledKotlin(fileName);
}
@TestMetadata("ManyAnnotations.kt")
public void testManyAnnotations() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/parameters/ManyAnnotations.kt");
@@ -113,6 +113,12 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD
doTest(fileName);
}
@TestMetadata("Constructor.kt")
public void testConstructor() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/Constructor.kt");
doTest(fileName);
}
@TestMetadata("DelegatedProperty.kt")
public void testDelegatedProperty() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/DelegatedProperty.kt");
@@ -350,6 +356,12 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD
doTest(fileName);
}
@TestMetadata("InnerClassConstructor.kt")
public void testInnerClassConstructor() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/parameters/InnerClassConstructor.kt");
doTest(fileName);
}
@TestMetadata("ManyAnnotations.kt")
public void testManyAnnotations() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/parameters/ManyAnnotations.kt");