add tests on implicit type with inaccessible annotations

^KT-63042
This commit is contained in:
Dmitrii Gridin
2023-10-31 14:26:44 +01:00
committed by Space Team
parent 80fcf9b09e
commit a25bac4bf9
22 changed files with 1803 additions and 0 deletions
@@ -3053,6 +3053,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/typeUse"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
}
@Test
@TestMetadata("implicitTypeWithInaccessibleAnnotation.kt")
public void testImplicitTypeWithInaccessibleAnnotation() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt");
}
@Test
@TestMetadata("kt19455.kt")
public void testKt19455() throws Exception {
@@ -3059,6 +3059,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/typeUse"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform");
}
@Test
@TestMetadata("implicitTypeWithInaccessibleAnnotation.kt")
public void testImplicitTypeWithInaccessibleAnnotation() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt");
}
@Test
@TestMetadata("kt19455.kt")
public void testKt19455() throws Exception {
@@ -0,0 +1,14 @@
package usage
@Target(AnnotationTarget.TYPE)
annotation class Anno(val s: String)
fun implicitType1() = TopLevelObject.expectedType()
object TopLevelObject {
fun expectedType2(): @Anno(privateConstVal) Int = 4
private const val privateConstVal = "privateConstVal"
fun expectedType(): @Anno(<!UNRESOLVED_REFERENCE!>privateConstVal<!>) Int = 4
}
fun implicitType2() = TopLevelObject.expectedType2()
@@ -0,0 +1,14 @@
package usage
@Target(AnnotationTarget.TYPE)
annotation class Anno(val s: String)
fun implicitType1() = TopLevelObject.expectedType()
object TopLevelObject {
fun expectedType2(): @Anno(privateConstVal) Int = 4
private const val privateConstVal = "privateConstVal"
fun expectedType(): @Anno(privateConstVal) Int = 4
}
fun implicitType2() = TopLevelObject.expectedType2()
@@ -0,0 +1,14 @@
package usage
@Target(AnnotationTarget.TYPE)
annotation class Anno(val s: String)
fun implicitType1() = TopLevelObject.expectedType()
object TopLevelObject {
fun expectedType2(): @Anno(<!UNRESOLVED_REFERENCE!>privateConstVal<!>) Int = 4
private const val privateConstVal = "privateConstVal"
fun expectedType(): @Anno(privateConstVal) Int = 4
}
fun implicitType2() = TopLevelObject.expectedType2()
@@ -3059,6 +3059,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/typeUse"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("implicitTypeWithInaccessibleAnnotation.kt")
public void testImplicitTypeWithInaccessibleAnnotation() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt");
}
@Test
@TestMetadata("kt19455.kt")
public void testKt19455() throws Exception {