Add test for KT-26638

This commit is contained in:
Dmitriy Novozhilov
2019-02-21 14:11:52 +03:00
parent 3e147af3c0
commit cfda468f13
5 changed files with 47 additions and 5 deletions
@@ -0,0 +1,21 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// Ann is not repeatable
annotation class Ann(val x: Int)
@get:Ann(10)
val a: String
@Ann(20) get() = "foo"
@set:Ann(10)
var b: String = ""
@Ann(20) set(value) { field = value }
@setparam:Ann(10)
var c = " "
set(@Ann(20) x) {}
@get:Ann(10)
<!REPEATED_ANNOTATION!>@get:Ann(20)<!>
val d: String
@Ann(30) <!REPEATED_ANNOTATION!>@Ann(40)<!> get() = "foo"
@@ -0,0 +1,11 @@
package
@setparam:Ann(x = 20) @setparam:Ann(x = 10) public var a: kotlin.String
public final annotation class Ann : kotlin.Annotation {
public constructor Ann(/*0*/ x: kotlin.Int)
public final val x: kotlin.Int
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -1444,6 +1444,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt");
}
@TestMetadata("kt26638.kt")
public void testKt26638() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/kt26638.kt");
}
@TestMetadata("ParamAnnotations.kt")
public void testParamAnnotations() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ParamAnnotations.kt");
@@ -1439,6 +1439,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt");
}
@TestMetadata("kt26638.kt")
public void testKt26638() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/kt26638.kt");
}
@TestMetadata("ParamAnnotations.kt")
public void testParamAnnotations() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ParamAnnotations.kt");
@@ -10618,6 +10618,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class FieldRename extends AbstractLightAnalysisModeTest {
@TestMetadata("jvmFieldNoClash1.kt")
public void ignoreJvmFieldNoClash1() throws Exception {
runTest("compiler/testData/codegen/box/fieldRename/jvmFieldNoClash1.kt");
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
@@ -10641,11 +10646,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/fieldRename/genericPropertyWithItself.kt");
}
@TestMetadata("jvmFieldNoClash1.kt")
public void testJvmFieldNoClash1() throws Exception {
runTest("compiler/testData/codegen/box/fieldRename/jvmFieldNoClash1.kt");
}
@TestMetadata("jvmFieldNoClash2.kt")
public void testJvmFieldNoClash2() throws Exception {
runTest("compiler/testData/codegen/box/fieldRename/jvmFieldNoClash2.kt");