[FIR] Add test for KT-55286

This commit is contained in:
Dmitriy Novozhilov
2022-12-06 10:48:02 +02:00
committed by Space Team
parent a86bc425e5
commit 2aad466d00
6 changed files with 111 additions and 0 deletions
@@ -674,6 +674,22 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
runTest("compiler/fir/analysis-tests/testData/resolve/whenWithWhenAsStatement.kt");
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/annotations")
@TestDataPath("$PROJECT_ROOT")
public class Annotations {
@Test
public void testAllFilesPresentInAnnotations() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/annotations"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@Test
@TestMetadata("kt55286.kt")
public void testKt55286() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.kt");
}
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments")
@TestDataPath("$PROJECT_ROOT")
@@ -569,6 +569,24 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/whenWithWhenAsStatement.kt");
}
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Annotations extends AbstractLazyBodyIsNotTouchedTilContractsPhaseTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInAnnotations() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/annotations"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@TestMetadata("kt55286.kt")
public void testKt55286() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.kt");
}
}
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -0,0 +1,32 @@
FILE: kt55286.kt
public final annotation class Deprecated<T> : R|kotlin/Annotation| {
public constructor<T>(): R|Deprecated<T>| {
super<R|kotlin/Any|>()
}
}
public open class Base : R|kotlin/Any| {
public constructor(@R|Deprecated<ERROR CLASS: Symbol not found for Nested>|() a: R|kotlin/String|): R|Base| {
super<R|kotlin/Any|>()
}
@R|Deprecated<ERROR CLASS: Symbol not found for Nested>|() public final val a: R|kotlin/String| = R|<local>/a|
public get(): R|kotlin/String|
public final class Nested : R|kotlin/Any| {
public constructor(): R|Base.Nested| {
super<R|kotlin/Any|>()
}
}
}
public final class Derived : R|Base| {
public constructor(@R|Deprecated<ERROR CLASS: Symbol not found for Nested>|() b: R|kotlin/String|): R|Derived| {
super<R|Base|>(String())
}
@R|Deprecated<ERROR CLASS: Symbol not found for Nested>|() public final val b: R|kotlin/String| = R|<local>/b|
public get(): R|kotlin/String|
}
@@ -0,0 +1,13 @@
// ISSUE: KT-55286
annotation class Deprecated<T>
open class Base(
@Deprecated<<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>Nested<!>> val a: String,
) {
class Nested
}
class Derived(
@Deprecated<<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>Nested<!>> val b: String,
) : Base("")
@@ -674,6 +674,22 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
runTest("compiler/fir/analysis-tests/testData/resolve/whenWithWhenAsStatement.kt");
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/annotations")
@TestDataPath("$PROJECT_ROOT")
public class Annotations {
@Test
public void testAllFilesPresentInAnnotations() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/annotations"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@Test
@TestMetadata("kt55286.kt")
public void testKt55286() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.kt");
}
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments")
@TestDataPath("$PROJECT_ROOT")
@@ -674,6 +674,22 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest("compiler/fir/analysis-tests/testData/resolve/whenWithWhenAsStatement.kt");
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/annotations")
@TestDataPath("$PROJECT_ROOT")
public class Annotations {
@Test
public void testAllFilesPresentInAnnotations() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/annotations"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@Test
@TestMetadata("kt55286.kt")
public void testKt55286() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.kt");
}
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments")
@TestDataPath("$PROJECT_ROOT")