diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index b3879364b3c..90dc9a0f34b 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -457,10 +457,6 @@ public abstract class Enum> : kotlin.Comparable { } } -@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE}) @kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) @kotlin.annotation.annotation() internal final class Exact : kotlin.Annotation { - /*primary*/ public constructor Exact() -} - @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE}) @kotlin.annotation.MustBeDocumented() @kotlin.annotation.annotation() public final class Extension : kotlin.Annotation { /*primary*/ public constructor Extension() } @@ -1055,10 +1051,6 @@ public interface MutableSet : kotlin.Set, kotlin.MutableCollection): kotlin.Boolean } -@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE}) @kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) @kotlin.annotation.annotation() internal final class NoInfer : kotlin.Annotation { - /*primary*/ public constructor NoInfer() -} - public final class Nothing { /*primary*/ private constructor Nothing() } diff --git a/compiler/testData/diagnostics/tests/inference/annotationsForResolve/exactAnnotation.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.kt similarity index 100% rename from compiler/testData/diagnostics/tests/inference/annotationsForResolve/exactAnnotation.kt rename to compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.kt diff --git a/compiler/testData/diagnostics/tests/inference/annotationsForResolve/exactAnnotation.txt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.txt similarity index 100% rename from compiler/testData/diagnostics/tests/inference/annotationsForResolve/exactAnnotation.txt rename to compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.txt diff --git a/compiler/testData/diagnostics/tests/inference/annotationsForResolve/noInferAnnotation.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAnnotation.kt similarity index 100% rename from compiler/testData/diagnostics/tests/inference/annotationsForResolve/noInferAnnotation.kt rename to compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAnnotation.kt diff --git a/compiler/testData/diagnostics/tests/inference/annotationsForResolve/noInferAnnotation.txt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAnnotation.txt similarity index 100% rename from compiler/testData/diagnostics/tests/inference/annotationsForResolve/noInferAnnotation.txt rename to compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAnnotation.txt diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java index bd874b0d289..7158e4d96b2 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java @@ -7347,27 +7347,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } - @TestMetadata("compiler/testData/diagnostics/tests/inference/annotationsForResolve") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class AnnotationsForResolve extends AbstractJetDiagnosticsTest { - public void testAllFilesPresentInAnnotationsForResolve() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/inference/annotationsForResolve"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("exactAnnotation.kt") - public void testExactAnnotation() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inference/annotationsForResolve/exactAnnotation.kt"); - doTest(fileName); - } - - @TestMetadata("noInferAnnotation.kt") - public void testNoInferAnnotation() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inference/annotationsForResolve/noInferAnnotation.kt"); - doTest(fileName); - } - } - @TestMetadata("compiler/testData/diagnostics/tests/inference/capturedTypes") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java index 1c305b8834c..45770c3cf00 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java @@ -615,6 +615,27 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/inference/kt4975.kt"); doTest(fileName); } + + @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class AnnotationsForResolve extends AbstractJetDiagnosticsTestWithStdLib { + public void testAllFilesPresentInAnnotationsForResolve() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("exactAnnotation.kt") + public void testExactAnnotation() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.kt"); + doTest(fileName); + } + + @TestMetadata("noInferAnnotation.kt") + public void testNoInferAnnotation() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAnnotation.kt"); + doTest(fileName); + } + } } @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/kotlinSignature") diff --git a/core/builtins/src/kotlin/Annotations.kt b/core/builtins/src/kotlin/Annotations.kt index cbea6951b52..709bf3b50cd 100644 --- a/core/builtins/src/kotlin/Annotations.kt +++ b/core/builtins/src/kotlin/Annotations.kt @@ -126,18 +126,4 @@ private annotation class external @Target(TYPE) @Retention(SOURCE) @MustBeDocumented -public annotation class UnsafeVariance - -/** - * Specifies that the corresponding type should be ignored during type inference. - */ -@Target(TYPE) -@Retention(SOURCE) -internal annotation class NoInfer - -/** - * Specifies that the constraint built for the type during type inference should be an equality one. - */ -@Target(TYPE) -@Retention(SOURCE) -internal annotation class Exact +public annotation class UnsafeVariance \ No newline at end of file diff --git a/libraries/stdlib/src/kotlin/util/Annotations.kt b/libraries/stdlib/src/kotlin/util/Annotations.kt new file mode 100644 index 00000000000..5a59a7d20b0 --- /dev/null +++ b/libraries/stdlib/src/kotlin/util/Annotations.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kotlin + +/** + * Specifies that the corresponding type should be ignored during type inference. + */ +@Target(AnnotationTarget.TYPE) +@Retention(AnnotationRetention.SOURCE) +internal annotation class NoInfer + +/** + * Specifies that the constraint built for the type during type inference should be an equality one. + */ +@Target(AnnotationTarget.TYPE) +@Retention(AnnotationRetention.SOURCE) +internal annotation class Exact \ No newline at end of file