From 7fb2bf00c55066dfd6d18196c2344a7083d4ac9e Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 19 Apr 2021 10:55:56 +0300 Subject: [PATCH] Force resolve annotations in annotation checker #KT-46173 Fixed --- ...irOldFrontendDiagnosticsTestGenerated.java | 6 ++ .../kotlin/resolve/AnnotationChecker.kt | 9 ++ .../cli/jvm/wrongAnnotationArgumentInCtor.out | 6 ++ .../tests/annotations/typeUse/kt46173.fir.kt | 10 ++ .../tests/annotations/typeUse/kt46173.kt | 10 ++ .../tests/annotations/typeUse/kt46173.txt | 11 +++ ...eForArgumentCallWithExactAnnotation.fir.kt | 4 +- ...cTypeForArgumentCallWithExactAnnotation.kt | 2 +- ...TypeForArgumentCallWithExactAnnotation.txt | 2 +- ...rArgumentCallWithExactAnnotation_ni.fir.kt | 4 +- ...peForArgumentCallWithExactAnnotation_ni.kt | 2 +- ...eForArgumentCallWithExactAnnotation_ni.txt | 2 +- ...tponedCompletionWithExactAnnotation.fir.kt | 4 +- .../postponedCompletionWithExactAnnotation.kt | 2 +- ...postponedCompletionWithExactAnnotation.txt | 2 +- ...nedCompletionWithExactAnnotation_ni.fir.kt | 4 +- ...stponedCompletionWithExactAnnotation_ni.kt | 2 +- ...tponedCompletionWithExactAnnotation_ni.txt | 2 +- .../elvisOperatorAgainstFlexibleType.fir.kt | 20 ---- .../elvisOperatorAgainstFlexibleType.kt | 3 +- .../elvisOperatorAgainstFlexibleType.txt | 2 +- .../implicitNothingInDelegate.fir.txt | 2 +- .../implicitNothingInDelegate.kt | 2 +- .../implicitNothingInDelegate.txt | 2 +- .../test/runners/DiagnosticTestGenerated.java | 6 ++ .../annotations/type-annotations/neg/1.kt | 19 ---- .../annotations/type-annotations/neg/10.kt | 35 ------- .../annotations/type-annotations/neg/11.kt | 46 --------- .../annotations/type-annotations/neg/2.kt | 23 ----- .../annotations/type-annotations/neg/3.kt | 31 ------ .../annotations/type-annotations/neg/4.kt | 24 ----- .../annotations/type-annotations/neg/5.kt | 27 ------ .../annotations/type-annotations/neg/6.kt | 37 -------- .../annotations/type-annotations/neg/7.kt | 29 ------ .../annotations/type-annotations/neg/8.kt | 27 ------ .../annotations/type-annotations/neg/9.kt | 26 ----- .../annotations/type-annotations/neg/10.kt | 4 +- .../annotations/type-annotations/neg/9.kt | 2 +- .../BlackBoxCodegenTestSpecGenerated.java | 94 ------------------- 39 files changed, 83 insertions(+), 462 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.txt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.fir.kt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/1.kt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/10.kt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/11.kt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/2.kt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/3.kt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/4.kt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/5.kt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/6.kt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/7.kt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/8.kt delete mode 100644 compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/9.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index 77aee800a44..1f3e21a824a 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -1834,6 +1834,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/annotations/typeUse/kt25876.kt"); } + @Test + @TestMetadata("kt46173.kt") + public void testKt46173() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.kt"); + } + @Test @TestMetadata("kt8325.kt") public void testKt8325() throws Exception { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt index 77fc30cc3a6..aae33a5fc63 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt @@ -27,6 +27,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.annotationClass import org.jetbrains.kotlin.resolve.descriptorUtil.getAnnotationRetention import org.jetbrains.kotlin.resolve.descriptorUtil.isRepeatableAnnotation import org.jetbrains.kotlin.resolve.inline.InlineUtil +import org.jetbrains.kotlin.resolve.lazy.descriptors.LazyAnnotationDescriptor import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils import org.jetbrains.kotlin.types.isError @@ -191,6 +192,14 @@ class AnnotationChecker( for (entry in entries) { checkAnnotationEntry(entry, actualTargets, trace) val descriptor = trace.get(BindingContext.ANNOTATION, entry) ?: continue + if (descriptor is LazyAnnotationDescriptor) { + /* + * There are no users of type annotations until backend, so if there are errors + * in annotation call then we should force resolve of it to detect and + * report them + */ + descriptor.forceResolveAllContents() + } val classDescriptor = descriptor.annotationClass ?: continue val useSiteTarget = entry.useSiteTarget?.getAnnotationUseSiteTarget() ?: annotated.getDefaultUseSiteTarget(descriptor) diff --git a/compiler/testData/cli/jvm/wrongAnnotationArgumentInCtor.out b/compiler/testData/cli/jvm/wrongAnnotationArgumentInCtor.out index 14a73ecdbbd..d6c03010c83 100644 --- a/compiler/testData/cli/jvm/wrongAnnotationArgumentInCtor.out +++ b/compiler/testData/cli/jvm/wrongAnnotationArgumentInCtor.out @@ -1,3 +1,9 @@ +compiler/testData/cli/jvm/wrongAnnotationArgumentInCtor.kt:4:32: error: too many arguments for public constructor Anno() defined in Anno +class UnresolvedArgument(@Anno(BLA) val s: Int) + ^ +compiler/testData/cli/jvm/wrongAnnotationArgumentInCtor.kt:4:32: error: unresolved reference: BLA +class UnresolvedArgument(@Anno(BLA) val s: Int) + ^ compiler/testData/cli/jvm/wrongAnnotationArgumentInCtor.kt:6:25: error: no value passed for parameter 'message' class WithoutArguments(@Deprecated val s: Int) ^ diff --git a/compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.fir.kt b/compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.fir.kt new file mode 100644 index 00000000000..35c06313357 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.fir.kt @@ -0,0 +1,10 @@ +// !LANGUAGE: +ProperCheckAnnotationsTargetInTypeUsePositions +// !DIAGNOSTICS: -USELESS_CAST +// ISSUE: KT-46173 + +@Target(AnnotationTarget.TYPE) +annotation class Ann(val s: String) + +fun some(): Int { + return 1 as @Ann(6) Int // should error but doesn't +} diff --git a/compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.kt b/compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.kt new file mode 100644 index 00000000000..98363990ca8 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.kt @@ -0,0 +1,10 @@ +// !LANGUAGE: +ProperCheckAnnotationsTargetInTypeUsePositions +// !DIAGNOSTICS: -USELESS_CAST +// ISSUE: KT-46173 + +@Target(AnnotationTarget.TYPE) +annotation class Ann(val s: String) + +fun some(): Int { + return 1 as @Ann(6) Int // should error but doesn't +} diff --git a/compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.txt b/compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.txt new file mode 100644 index 00000000000..d5c421c0fb2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.txt @@ -0,0 +1,11 @@ +package + +public fun some(): kotlin.Int + +@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE}) public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ s: kotlin.String) + public final val s: kotlin.String + 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 +} diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.fir.kt index 8891ffef862..ec17aa6181f 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.fir.kt @@ -5,8 +5,8 @@ interface A interface B : A interface C : A -@Suppress("INVISIBLE_REFERENCE") -fun select(x: K, y: K): @kotlin.internal.Exact K = x +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN") +fun select(x: K, y: K): @kotlin.internal.Exact K = x fun foo(a: Any) {} diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.kt index 2ef39a49a17..0d324dec1e2 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.kt @@ -5,7 +5,7 @@ interface A interface B : A interface C : A -@Suppress("INVISIBLE_REFERENCE") +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN") fun select(x: K, y: K): @kotlin.internal.Exact K = x fun foo(a: Any) {} diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.txt b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.txt index 02d30ed8689..18bddefabf1 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.txt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation.txt @@ -1,7 +1,7 @@ package public fun foo(/*0*/ a: kotlin.Any): kotlin.Unit -@kotlin.Suppress(names = {"INVISIBLE_REFERENCE"}) public fun select(/*0*/ x: K, /*1*/ y: K): K +@kotlin.Suppress(names = {"INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN"}) public fun select(/*0*/ x: K, /*1*/ y: K): K public fun test(/*0*/ b: B, /*1*/ c: C): kotlin.Unit public interface A { diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.fir.kt index f57407ef00e..b3289dd2fd6 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.fir.kt @@ -5,8 +5,8 @@ interface A interface B : A interface C : A -@Suppress("INVISIBLE_REFERENCE") -fun select(x: K, y: K): @kotlin.internal.Exact K = x +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN") +fun select(x: K, y: K): @kotlin.internal.Exact K = x fun foo(a: Any) {} diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.kt index 01900f71d39..014c3399caa 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.kt @@ -5,7 +5,7 @@ interface A interface B : A interface C : A -@Suppress("INVISIBLE_REFERENCE") +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN") fun select(x: K, y: K): @kotlin.internal.Exact K = x fun foo(a: Any) {} diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.txt b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.txt index 02d30ed8689..18bddefabf1 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.txt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/lessSpecificTypeForArgumentCallWithExactAnnotation_ni.txt @@ -1,7 +1,7 @@ package public fun foo(/*0*/ a: kotlin.Any): kotlin.Unit -@kotlin.Suppress(names = {"INVISIBLE_REFERENCE"}) public fun select(/*0*/ x: K, /*1*/ y: K): K +@kotlin.Suppress(names = {"INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN"}) public fun select(/*0*/ x: K, /*1*/ y: K): K public fun test(/*0*/ b: B, /*1*/ c: C): kotlin.Unit public interface A { diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.fir.kt index 664de2117a5..151ff162527 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.fir.kt @@ -5,8 +5,8 @@ interface ISample fun elvisSimple(x: K?, y: K): K = y -@Suppress("INVISIBLE_REFERENCE") -fun elvisExact(x: K?, y: K): @kotlin.internal.Exact K = y +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN") +fun elvisExact(x: K?, y: K): @kotlin.internal.Exact K = y fun materialize(): T? = TODO() diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.kt index 2d1baf24d3e..769df3b93eb 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.kt @@ -5,7 +5,7 @@ interface ISample fun elvisSimple(x: K?, y: K): K = y -@Suppress("INVISIBLE_REFERENCE") +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN") fun elvisExact(x: K?, y: K): @kotlin.internal.Exact K = y fun materialize(): T? = TODO() diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.txt b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.txt index 84135a36988..ee57c7aa602 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.txt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.txt @@ -1,6 +1,6 @@ package -@kotlin.Suppress(names = {"INVISIBLE_REFERENCE"}) public fun elvisExact(/*0*/ x: K?, /*1*/ y: K): K +@kotlin.Suppress(names = {"INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN"}) public fun elvisExact(/*0*/ x: K?, /*1*/ y: K): K public fun elvisSimple(/*0*/ x: K?, /*1*/ y: K): K public fun materialize(): T? public fun test(/*0*/ nullableSample: ISample, /*1*/ any: kotlin.Any): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.fir.kt index b57495007af..849c2b78422 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.fir.kt @@ -5,8 +5,8 @@ interface ISample fun elvisSimple(x: K?, y: K): K = y -@Suppress("INVISIBLE_REFERENCE") -fun elvisExact(x: K?, y: K): @kotlin.internal.Exact K = y +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN") +fun elvisExact(x: K?, y: K): @kotlin.internal.Exact K = y fun materialize(): T? = null fun Any?.materialize(): T = null as T diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.kt index 4f68473d864..a203301e479 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.kt @@ -5,7 +5,7 @@ interface ISample fun elvisSimple(x: K?, y: K): K = y -@Suppress("INVISIBLE_REFERENCE") +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN") fun elvisExact(x: K?, y: K): @kotlin.internal.Exact K = y fun materialize(): T? = null diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.txt b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.txt index 8198e4ac6b2..0bf2a6f2c8b 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.txt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.txt @@ -1,6 +1,6 @@ package -@kotlin.Suppress(names = {"INVISIBLE_REFERENCE"}) public fun elvisExact(/*0*/ x: K?, /*1*/ y: K): K +@kotlin.Suppress(names = {"INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN"}) public fun elvisExact(/*0*/ x: K?, /*1*/ y: K): K public fun elvisSimple(/*0*/ x: K?, /*1*/ y: K): K public fun materialize(): T? public fun test(/*0*/ nullableSample: ISample, /*1*/ any: kotlin.Any): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.fir.kt deleted file mode 100644 index f89a568e907..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER - -// FILE: Foo.java - -public class Foo { - public static void create(java.util.Map m) { return null; } -} - -// FILE: test.kt - -fun test(properties: Map, nullableProperties: Map?) { - val f1 = Foo.create(select1(properties, myEmptyMap())) - val f2 = Foo.create(nullableProperties ?: myEmptyMap()) -} - -fun myEmptyMap(): Map = TODO() - -@Suppress("INVISIBLE_REFERENCE") -fun select1(x: S, y: S): @kotlin.internal.Exact S = y diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.kt index 207fe35b53b..84837bd0170 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER @@ -16,5 +17,5 @@ fun test(properties: Map, nullableProperties: Map myEmptyMap(): Map = TODO() -@Suppress("INVISIBLE_REFERENCE") +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN") fun select1(x: S, y: S): @kotlin.internal.Exact S = y diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.txt index 35640e14375..0479da3da82 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/elvisOperatorAgainstFlexibleType.txt @@ -1,7 +1,7 @@ package public fun myEmptyMap(): kotlin.collections.Map -@kotlin.Suppress(names = {"INVISIBLE_REFERENCE"}) public fun select1(/*0*/ x: S, /*1*/ y: S): S +@kotlin.Suppress(names = {"INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "HIDDEN"}) public fun select1(/*0*/ x: S, /*1*/ y: S): S public fun test(/*0*/ properties: kotlin.collections.Map, /*1*/ nullableProperties: kotlin.collections.Map?): kotlin.Unit public open class Foo { diff --git a/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.fir.txt b/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.fir.txt index 6f27fd99014..b7a4a84b2a3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.fir.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.fir.txt @@ -1,5 +1,5 @@ FILE: implicitNothingInDelegate.kt - @R|kotlin/Suppress|(vararg(String(INVISIBLE_REFERENCE))) public final operator fun R|kotlin/collections/Map|.getValue(thisRef: R|kotlin/Any?|, property: R|kotlin/reflect/KProperty<*>|): R|V1| { + @R|kotlin/Suppress|(vararg(String(INVISIBLE_REFERENCE), String(INVISIBLE_MEMBER))) public final operator fun R|kotlin/collections/Map|.getValue(thisRef: R|kotlin/Any?|, property: R|kotlin/reflect/KProperty<*>|): R|V1| { ^getValue Null(null)!! } public final val m2: R|kotlin/collections/Map| = R|kotlin/collections/mapOf|(String(baz).R|kotlin/to|(String(bat))) diff --git a/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.kt b/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.kt index 792c2c46961..a032ffe9047 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.kt @@ -4,7 +4,7 @@ import kotlin.reflect.KProperty -@Suppress("INVISIBLE_REFERENCE") +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") public operator fun Map.getValue(thisRef: Any?, property: KProperty<*>): V1 = null!! val m2: Map = mapOf("baz" to "bat") diff --git a/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.txt b/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.txt index cc3247a96f3..8f71f536485 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/implicitNothingInDelegate.txt @@ -3,5 +3,5 @@ package public val bar: kotlin.String public val m2: kotlin.collections.Map public fun foo(): kotlin.Unit -@kotlin.Suppress(names = {"INVISIBLE_REFERENCE"}) public operator fun kotlin.collections.Map.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.reflect.KProperty<*>): V1 +@kotlin.Suppress(names = {"INVISIBLE_REFERENCE", "INVISIBLE_MEMBER"}) public operator fun kotlin.collections.Map.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.reflect.KProperty<*>): V1 diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 5750b722b5a..64ce0b1985b 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -1840,6 +1840,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/typeUse/kt25876.kt"); } + @Test + @TestMetadata("kt46173.kt") + public void testKt46173() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/kt46173.kt"); + } + @Test @TestMetadata("kt8325.kt") public void testKt8325() throws Exception { diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/1.kt b/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/1.kt deleted file mode 100644 index 2e9dd39178b..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/1.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) - * - * SECTIONS: annotations, type-annotations - * NUMBER: 1 - * DESCRIPTION: Type annotations on return type with unresolved reference in parameters. - * ISSUES: KT-28424 - */ - -@Target(AnnotationTarget.TYPE) -annotation class Ann - -fun foo(x: String): @Ann(unresolved_reference) String { - return x -} - -fun box(): String? { - return "OK" -} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/10.kt b/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/10.kt deleted file mode 100644 index 6aba7aeabf7..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/10.kt +++ /dev/null @@ -1,35 +0,0 @@ -// WITH_RUNTIME - -/* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) - * - * SECTIONS: annotations, type-annotations - * NUMBER: 10 - * DESCRIPTION: Type annotations on a lambda type with unresolved reference in parameters. - * ISSUES: KT-28424 - */ - -@Target(AnnotationTarget.TYPE) -annotation class Ann(val x: Int) - -fun case_1(): Any { - val x: (Int) -> @Ann(unresolved_reference) Unit = {} - - return x -} - -fun case_2(): Any { - val x: (@Ann(unresolved_reference) Int) -> Unit = { a: Int -> println(a) } - - return x -} - -fun box(): String? { - val x = case_1() - val y = case_2() - - if (x == null) return null - if (y == null) return null - - return "OK" -} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/11.kt b/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/11.kt deleted file mode 100644 index 27057b63d25..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/11.kt +++ /dev/null @@ -1,46 +0,0 @@ -/* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) - * - * SECTIONS: annotations, type-annotations - * NUMBER: 11 - * DESCRIPTION: Type annotations with invalid target. - * ISSUES: KT-28449 - */ - -@Retention(AnnotationRetention.RUNTIME) -@Target(AnnotationTarget.PROPERTY_GETTER) -annotation class Ann(val x: Int) - -class Foo : @Ann(10) Any() - -class Bar - -fun case_3(a: Any): Int? { - return if (a is @Ann(10) String) 10 else null -} - -open class TypeToken - -val case_4 = object : TypeToken<@Ann(10) String>() {} - -fun case_5(a: Any): Any { - a as @Ann(10) Int - - return a -} - -fun box(): String? { - val x1 = Foo() - val x2 = Bar() - val x3 = case_3(".") - val x4 = case_4 - val x5 = case_5(10) - - if (x1 == null) return null - if (x2 == null) return null - if (x3 == null) return null - if (x4 == null) return null - if (x5 == null) return null - - return "OK" -} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/2.kt b/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/2.kt deleted file mode 100644 index 66b0c3e7462..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/2.kt +++ /dev/null @@ -1,23 +0,0 @@ -/* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) - * - * SECTIONS: annotations, type-annotations - * NUMBER: 2 - * DESCRIPTION: Type annotations on supertypes with unresolved reference in parameters. - * ISSUES: KT-28424 - */ - -@Target(AnnotationTarget.TYPE) -annotation class Ann(val x: Int) - -abstract class Foo : @Ann(unresolved_reference) Any() - -class Bar: Foo() - -fun box(): String? { - val x = Bar() - - if (x == null) return null - - return "OK" -} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/3.kt b/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/3.kt deleted file mode 100644 index 3d0ea9b3e23..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/3.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) - * - * SECTIONS: annotations, type-annotations - * NUMBER: 3 - * DESCRIPTION: Type annotations on parameter types with unresolved reference in parameters. - * ISSUES: KT-28424 - */ - -@Target(AnnotationTarget.TYPE) -annotation class Ann(val x: Int) - -class Inv - -fun foo(i: Inv<@Ann(unresolved_reference) String>) {} - -fun bar(vararg a: @Ann(unresolved_reference) Any) {} - -class A(a: @Ann(unresolved_reference) T) - -fun box(): String? { - val x = foo(Inv()) - val y = bar(1, 2, 3) - val z = A(10) - - if (x == null) return null - if (y == null) return null - if (z == null) return null - - return "OK" -} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/4.kt b/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/4.kt deleted file mode 100644 index e3726b8983c..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/4.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) - * - * SECTIONS: annotations, type-annotations - * NUMBER: 4 - * DESCRIPTION: Type annotations on type arguments for a containing type of return type, with unresolved reference in parameters. - * ISSUES: KT-28424 - */ - -@Target(AnnotationTarget.TYPE) -annotation class Ann(val x: Int) - -class Inv - -fun case_1(): Inv<@Ann(unresolved_reference) String> = TODO() - -fun box(): String? { - try { - val x = case_1() - if (x == null) return null - } catch (e: NotImplementedError) {} - - return "OK" -} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/5.kt b/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/5.kt deleted file mode 100644 index 6aeeadaf94f..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/5.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) - * - * SECTIONS: annotations, type-annotations - * NUMBER: 5 - * DESCRIPTION: Type annotations on upper bounds with unresolved reference in parameters. - * ISSUES: KT-28424 - */ - -@Target(AnnotationTarget.TYPE) -annotation class Ann(val x: Int) - -abstract class Bar - -class Foo : Bar() - -class B where @Ann(unresolved_reference) T : Number - -fun box(): String? { - val x = Foo() - val y = B() - - if (x == null) return null - if (y == null) return null - - return "OK" -} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/6.kt b/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/6.kt deleted file mode 100644 index 453027ffacb..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/6.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) - * - * SECTIONS: annotations, type-annotations - * NUMBER: 6 - * DESCRIPTION: Type annotations inside type check and cast expression with unresolved reference in parameters. - * ISSUES: KT-28424 - */ - -@Target(AnnotationTarget.TYPE) -annotation class Ann(val x: Int) - -fun case_1(a: Any): Int? { - return if (a is @Ann(unresolved_reference) String) 10 else null -} - -fun case_2(a: Any): Any { - return a as @Ann(unresolved_reference) String -} - -fun case_3_1(a: Any) = 10 - -fun case_3(a: Any): Any { - return case_3_1(a as @Ann(unresolved_reference) String) -} - -fun box(): String? { - val x = case_1(".") - val y = case_2(".") - val z = case_3(".") - - if (x == null) return null - if (y == null) return null - if (z == null) return null - - return "OK" -} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/7.kt b/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/7.kt deleted file mode 100644 index 73579ff51b3..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/7.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) - * - * SECTIONS: annotations, type-annotations - * NUMBER: 7 - * DESCRIPTION: Type annotations on a type in an anonymous object expression, with unresolved reference in parameters. - * ISSUES: KT-28424 - */ - -@Target(AnnotationTarget.TYPE) -annotation class Ann - -open class TypeToken - -val case_1 = object : TypeToken<@Ann(unresolved_reference) String>() {} - -interface A - -val case_2 = object: @Ann(unresolved_reference) A {} - -fun box(): String? { - val x = case_1 - val y = case_2 - - if (x == null) return null - if (y == null) return null - - return "OK" -} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/8.kt b/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/8.kt deleted file mode 100644 index 5f36e32e09b..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/8.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) - * - * SECTIONS: annotations, type-annotations - * NUMBER: 8 - * DESCRIPTION: Type annotations on a receiver type (for an extension property only), with unresolved reference in parameters. - * ISSUES: KT-28424 - */ - -@Target(AnnotationTarget.TYPE) -annotation class Ann(val x: Int) - -val @Ann(unresolved_reference) T.test // OK, error only in IDE but not in the compiler - get() = 10 - -val @Ann(unresolved_reference) Int.test - get() = 10 - -fun box(): String? { - val x = 10.test - val y = '.'.test - - if (x == null) return null - if (y == null) return null - - return "OK" -} diff --git a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/9.kt b/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/9.kt deleted file mode 100644 index cac2990b32c..00000000000 --- a/compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/9.kt +++ /dev/null @@ -1,26 +0,0 @@ -/* - * KOTLIN CODEGEN BOX NOT LINKED SPEC TEST (NEGATIVE) - * - * SECTIONS: annotations, type-annotations - * NUMBER: 9 - * DESCRIPTION: Type annotations on a setter argument type with unresolved reference in parameters. - * ISSUES: KT-28424 - */ - -@Target(AnnotationTarget.TYPE) -annotation class Ann - -var T.test - get() = 11 - set(value: @Ann(unresolved_reference) Int) {} - -fun box(): String? { - val x = 10.test - 10.test = 11 - val y = 10.test - - if (x == null) return null - if (y == null) return null - - return "OK" -} diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/10.kt b/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/10.kt index ec4a7394895..77b3ed19f2b 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/10.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/10.kt @@ -18,7 +18,7 @@ annotation class Ann(val x: Int) * UNEXPECTED BEHAVIOUR */ fun case_1() { - val x: (Int) -> @Ann(unresolved_reference) Unit = {} // OK, no error in IDE and in the compiler + val x: (Int) -> @Ann(unresolved_reference) Unit = {} // OK, no error in IDE and in the compiler } /* @@ -26,7 +26,7 @@ fun case_1() { * UNEXPECTED BEHAVIOUR */ fun case_2() { - val x: (@Ann(unresolved_reference) Int) -> Unit = { a: Int -> println(a) } // OK, no error in IDE and in the compiler + val x: (@Ann(unresolved_reference) Int) -> Unit = { a: Int -> println(a) } // OK, no error in IDE and in the compiler } // TESTCASE NUMBER: 3 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/9.kt b/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/9.kt index 5ac5cfe9a62..916806c465c 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/9.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/9.kt @@ -18,4 +18,4 @@ annotation class Ann var T.test get() = 11 - set(value: @Ann(unresolved_reference) Int) {} + set(value: @Ann(unresolved_reference) Int) {} diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java index 75443eab388..efe02731b1c 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/codegen/BlackBoxCodegenTestSpecGenerated.java @@ -4341,100 +4341,6 @@ public class BlackBoxCodegenTestSpecGenerated extends AbstractBlackBoxCodegenTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/notLinked"), Pattern.compile("^(.+)\\.kt$"), null, true); } - @TestMetadata("compiler/tests-spec/testData/codegen/box/notLinked/annotations") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Annotations extends AbstractBlackBoxCodegenTestSpec { - 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/tests-spec/testData/codegen/box/notLinked/annotations"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @TestMetadata("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Type_annotations extends AbstractBlackBoxCodegenTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInType_annotations() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @TestMetadata("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractBlackBoxCodegenTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - @TestMetadata("1.kt") - public void test1() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/1.kt"); - } - - @TestMetadata("10.kt") - public void test10() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/10.kt"); - } - - @TestMetadata("11.kt") - public void test11() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/11.kt"); - } - - @TestMetadata("2.kt") - public void test2() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/2.kt"); - } - - @TestMetadata("3.kt") - public void test3() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/3.kt"); - } - - @TestMetadata("4.kt") - public void test4() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/4.kt"); - } - - @TestMetadata("5.kt") - public void test5() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/5.kt"); - } - - @TestMetadata("6.kt") - public void test6() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/6.kt"); - } - - @TestMetadata("7.kt") - public void test7() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/7.kt"); - } - - @TestMetadata("8.kt") - public void test8() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/8.kt"); - } - - @TestMetadata("9.kt") - public void test9() throws Exception { - runTest("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg/9.kt"); - } - - public void testAllFilesPresentInNeg() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/codegen/box/notLinked/annotations/type-annotations/neg"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - } - } - } - @TestMetadata("compiler/tests-spec/testData/codegen/box/notLinked/flexibility") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)