diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index 23146a34aaf..d14b99dae2b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -140,6 +140,11 @@ public interface Errors { DiagnosticFactory0 INAPPLICABLE_PARAM_TARGET = DiagnosticFactory0.create(ERROR); DiagnosticFactory1 REDUNDANT_ANNOTATION_TARGET = DiagnosticFactory1.create(WARNING); + DiagnosticFactory0 DEPRECATED_UNESCAPED_ANNOTATION = DiagnosticFactory0.create(WARNING); + DiagnosticFactory0 DEPRECATED_ESCAPED_MODIFIER = DiagnosticFactory0.create(WARNING); + DiagnosticFactory1 DEPRECATED_ANNOTATION_THAT_BECOMES_MODIFIER = DiagnosticFactory1.create(WARNING); + + // Classes and traits DiagnosticFactory0 PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE = diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index d93c69fc59b..c4c61d4e453 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -132,6 +132,10 @@ public class DefaultErrorMessages { MAP.put(INAPPLICABLE_PARAM_TARGET, "''@param:'' annotations could be applied only to primary constructor parameters"); MAP.put(REDUNDANT_ANNOTATION_TARGET, "Redundant annotation target ''{0}''", STRING); + MAP.put(DEPRECATED_UNESCAPED_ANNOTATION, "Annotations without '@' are deprecated now"); + MAP.put(DEPRECATED_ESCAPED_MODIFIER, "Modifiers with '@' are deprecated now"); + MAP.put(DEPRECATED_ANNOTATION_THAT_BECOMES_MODIFIER, "Annotation ''{0}'' will become a modifier soon. Do not use ''@'' before it", STRING); + MAP.put(REDUNDANT_MODIFIER, "Modifier ''{0}'' is redundant because ''{1}'' is present", TO_STRING, TO_STRING); MAP.put(ABSTRACT_MODIFIER_IN_TRAIT, "Modifier ''abstract'' is redundant in interface"); MAP.put(REDUNDANT_MODIFIER_IN_GETTER, "Visibility modifiers are redundant in getter"); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetAnnotationEntry.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetAnnotationEntry.java index ebba0e692dd..6ce286e75f1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetAnnotationEntry.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetAnnotationEntry.java @@ -108,6 +108,12 @@ public class JetAnnotationEntry extends JetElementImplStub) { @@ -71,6 +73,15 @@ public class AnnotationChecker(private val additionalCheckers: Iterable 0) { g3(counter - 1) } } g3(1000000) diff --git a/compiler/testData/diagnostics/tests/Casts.kt b/compiler/testData/diagnostics/tests/Casts.kt index 3ac37660d11..0e6d1a3fe01 100644 --- a/compiler/testData/diagnostics/tests/Casts.kt +++ b/compiler/testData/diagnostics/tests/Casts.kt @@ -18,6 +18,6 @@ fun test() : Unit { val s = "" as Any ("" as String?)?.length() (data@("" as String?))?.length() - (@data()( "" as String?))?.length() + (@MustBeDocumented()( "" as String?))?.length() Unit } diff --git a/compiler/testData/diagnostics/tests/PackageInTypePosition.kt b/compiler/testData/diagnostics/tests/PackageInTypePosition.kt index 121c770ff01..41dc371632b 100644 --- a/compiler/testData/diagnostics/tests/PackageInTypePosition.kt +++ b/compiler/testData/diagnostics/tests/PackageInTypePosition.kt @@ -6,4 +6,4 @@ package foo // FILE: b.kt -foo fun bar(p: foo): foo = null!! \ No newline at end of file +@foo fun bar(p: foo): foo = null!! \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt b/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt index d3677e17d62..c5e43c40d1c 100644 --- a/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt +++ b/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt @@ -1,5 +1,5 @@ import java.util.ArrayList -ArrayList(1, 1) fun b() {} -Xoo(x) fun c() {} -java.lang.Deprecated(x) fun a() {} \ No newline at end of file +@ArrayList(1, 1) fun b() {} +@Xoo(x) fun c() {} +@java.lang.Deprecated(x) fun a() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.kt index 428f14df745..32e92a33f72 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.kt @@ -1,2 +1,2 @@ annotation class ann -class Annotated(ann val x: Int) \ No newline at end of file +class Annotated(@ann val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructorParams.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructorParams.kt index 975cb343cdb..6160208f955 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructorParams.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructorParams.kt @@ -4,12 +4,12 @@ import java.lang.Deprecated as deprecated import java.lang.SuppressWarnings as suppresswarnings -deprecated suppresswarnings val s: String = ""; +@deprecated @suppresswarnings val s: String = ""; -deprecated suppresswarnings fun main(args : Array) { +@deprecated @suppresswarnings fun main(args : Array) { System.out.println("Hello, world!") } -class Test(deprecated val s: String, - suppresswarnings val x : Int) {} +class Test(@deprecated val s: String, + @suppresswarnings val x : Int) {} diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.kt index 4d09e688396..a1ef09e0da3 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.kt @@ -2,4 +2,4 @@ annotation class Base(val x: Int) annotation class UseBase(val b: Base = Base(0)) -UseBase class My +@UseBase class My diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationForObject.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationForObject.kt index c9e102f3ce1..1c983e84865 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationForObject.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationForObject.kt @@ -1,3 +1,3 @@ // Check that there won't be "Rewrite at slice ANNOTATION key" exception - EA-36935 -someErrorAnnotation object Test { +@someErrorAnnotation object Test { } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationIdentifier.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationIdentifier.kt index ac792e5905f..a6eedf82a62 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationIdentifier.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationIdentifier.kt @@ -6,11 +6,11 @@ annotation class annotation package test -test.annotation class annotation +@test.annotation class annotation -kotlin.annotation.annotation class realAnnotation +@kotlin.annotation.annotation class realAnnotation -realAnnotation class My +@realAnnotation class My // FILE: other/c.kt @@ -18,8 +18,8 @@ package other annotation class My -test.annotation class Your +@test.annotation class Your -kotlin.annotation.annotation class His +@kotlin.annotation.annotation class His -My class Our \ No newline at end of file +@My class Our \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.kt index f17ab7bf642..bfc2133b520 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.kt @@ -2,5 +2,5 @@ package test annotation class A(val a: Int = 12, val b: String = "Test", val c: String) -A(a = 12, c = "Hello") +@A(a = 12, c = "Hello") object SomeObject diff --git a/compiler/testData/diagnostics/tests/annotations/BasicAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/BasicAnnotations.kt index 95df6b01ccc..305ef320dd2 100644 --- a/compiler/testData/diagnostics/tests/annotations/BasicAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/BasicAnnotations.kt @@ -2,9 +2,9 @@ annotation class my annotation class my1(val i : Int) annotation class my2(val i : Int = 0) -my fun foo() {} -my1 fun foo2() {} -my1(2) fun foo3() {} -my2() fun foo4() {} -my2 fun foo41() {} -my2(2) fun foo42() {} +@my fun foo() {} +@my1 fun foo2() {} +@my1(2) fun foo3() {} +@my2() fun foo4() {} +@my2 fun foo41() {} +@my2(2) fun foo42() {} diff --git a/compiler/testData/diagnostics/tests/annotations/ConstructorCall.kt b/compiler/testData/diagnostics/tests/annotations/ConstructorCall.kt index 35ed8d1c673..0dea7da9aa2 100644 --- a/compiler/testData/diagnostics/tests/annotations/ConstructorCall.kt +++ b/compiler/testData/diagnostics/tests/annotations/ConstructorCall.kt @@ -6,11 +6,11 @@ annotation class Ann3(val a: Ann1 = Ann1(1)) annotation class Ann4(val value: String) -Ann2(Ann1(1)) val a = 1 +@Ann2(Ann1(1)) val a = 1 -Ann2(a = Ann1(1)) val c = 2 +@Ann2(a = Ann1(1)) val c = 2 -Ann4("a") class MyClass +@Ann4("a") class MyClass fun foo() { Ann() diff --git a/compiler/testData/diagnostics/tests/annotations/DanglingInScript.kt b/compiler/testData/diagnostics/tests/annotations/DanglingInScript.kt index aaa6c306aeb..e5ea165258e 100644 --- a/compiler/testData/diagnostics/tests/annotations/DanglingInScript.kt +++ b/compiler/testData/diagnostics/tests/annotations/DanglingInScript.kt @@ -1,5 +1,5 @@ // FILE: script.kts -@annotation class Ann +annotation class Ann @Ann \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/Deprecated.kt b/compiler/testData/diagnostics/tests/annotations/Deprecated.kt index fe3cc5b2afc..42fa80799e3 100644 --- a/compiler/testData/diagnostics/tests/annotations/Deprecated.kt +++ b/compiler/testData/diagnostics/tests/annotations/Deprecated.kt @@ -1,5 +1,5 @@ import java.lang.Deprecated as deprecated -java.lang.Deprecated fun foo() {} +@java.lang.Deprecated fun foo() {} -deprecated fun foo1() {} \ No newline at end of file +@deprecated fun foo1() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.kt b/compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.kt index 98a8f9d9e4e..78cee80327c 100644 --- a/compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.kt +++ b/compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.kt @@ -3,6 +3,6 @@ import java.lang.annotation.* @java.lang.annotation.Retention(RetentionPolicy.CLASS) annotation class my -Retention(RetentionPolicy.RUNTIME) -Target(ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR) +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR) annotation class my1 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt b/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt index eb62170eaa2..2343a8f7f40 100644 --- a/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt +++ b/compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt @@ -1,4 +1,4 @@ // Functions can be recursively annotated annotation class ann(val x: Int) -ann(bar()) fun foo() = 1 -ann(foo()) fun bar() = 2 \ No newline at end of file +@ann(bar()) fun foo() = 1 +@ann(foo()) fun bar() = 2 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/NonAnnotationClass.kt b/compiler/testData/diagnostics/tests/annotations/NonAnnotationClass.kt index d71367298d0..54466dc249f 100644 --- a/compiler/testData/diagnostics/tests/annotations/NonAnnotationClass.kt +++ b/compiler/testData/diagnostics/tests/annotations/NonAnnotationClass.kt @@ -1,3 +1,3 @@ class Foo -Foo class Bar \ No newline at end of file +@Foo class Bar \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.kt index 4f1a151932f..86351a434ee 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.kt @@ -1,3 +1,3 @@ // Class CAN be recursively annotated -RecursivelyAnnotated(1) +@RecursivelyAnnotated(1) annotation class RecursivelyAnnotated(val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.kt index cbe17924315..b486f2855b4 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalFunction.kt @@ -1,3 +1,3 @@ // Functions can be recursively annotated annotation class ann(val x: Int) -ann(foo()) fun foo() = 1 \ No newline at end of file +@ann(foo()) fun foo() = 1 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.kt index dc51a248052..d5618920bdd 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.kt @@ -1,3 +1,3 @@ // Properties can be recursively annotated annotation class ann(val x: Int) -ann(x) val x: Int = 1 \ No newline at end of file +@ann(x) val x: Int = 1 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.kt index 2c351f16696..e4277530222 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.kt @@ -1,2 +1,2 @@ // Class constructor parameter CAN be recursively annotated -annotation class RecursivelyAnnotated(RecursivelyAnnotated(1) val x: Int) \ No newline at end of file +annotation class RecursivelyAnnotated(@RecursivelyAnnotated(1) val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedProperty.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedProperty.kt index 4a68ee5f092..603d997b238 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedProperty.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedProperty.kt @@ -1,5 +1,5 @@ // Properties can be recursively annotated annotation class ann(val x: Int) class My { - ann(x) val x: Int = 1 + @ann(x) val x: Int = 1 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.kt index a886f3e7933..ecd5c6fb4d8 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.kt @@ -1,2 +1,2 @@ // Class constructor parameter CAN be recursively annotated -class RecursivelyAnnotated(RecursivelyAnnotated(1) val x: Int) \ No newline at end of file +class RecursivelyAnnotated(@RecursivelyAnnotated(1) val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt b/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt index 9328179c44d..85f6f537376 100644 --- a/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt +++ b/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt @@ -3,7 +3,7 @@ package test // Checks that there is no rewrite error at ANNOTATION slice because of resolving annotations for object in lazy resolve and resolving // object as property (method tries to resolve annotations too). -BadAnnotation +@BadAnnotation object SomeObject val some = SomeObject \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.kt b/compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.kt index 994539b7681..21deee04336 100644 --- a/compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.kt +++ b/compiler/testData/diagnostics/tests/annotations/WrongAnnotationArgsOnObject.kt @@ -1,6 +1,6 @@ package test -BadAnnotation(1) +@BadAnnotation(1) object SomeObject val some = SomeObject diff --git a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/enumConst.kt b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/enumConst.kt index ab88f5793da..b85caeb8249 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/enumConst.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/enumConst.kt @@ -1,6 +1,6 @@ annotation class AnnE(val i: MyEnum) -AnnE(e) +@AnnE(e) class Test val e: MyEnum = MyEnum.A @@ -9,5 +9,5 @@ enum class MyEnum { A } -AnnE(Test()) +@AnnE(Test()) class Test2 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/javaProperties.kt b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/javaProperties.kt index 48e9586c6a3..f19072ac99b 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/javaProperties.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/javaProperties.kt @@ -13,7 +13,7 @@ public class Test { // FILE: a.kt annotation class Ann(vararg val i: Int) -Ann( +@Ann( Test.i1, Test.i2, Test.i3, diff --git a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/kotlinProperties.kt b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/kotlinProperties.kt index a25cadcf4c6..b0308605b29 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/kotlinProperties.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/kotlinProperties.kt @@ -1,6 +1,6 @@ annotation class Ann(vararg val i: Int) -Ann( +@Ann( i1, i2, i3, diff --git a/compiler/testData/diagnostics/tests/annotations/atAnnotationResolve.kt b/compiler/testData/diagnostics/tests/annotations/atAnnotationResolve.kt index 1ddd00c48d2..b89137da40b 100644 --- a/compiler/testData/diagnostics/tests/annotations/atAnnotationResolve.kt +++ b/compiler/testData/diagnostics/tests/annotations/atAnnotationResolve.kt @@ -6,7 +6,7 @@ @Repeatable annotation class Ann(val x: Int = 6) -@Ann(1) @Ann(2) @Ann(3) @private class A @Ann constructor() { +@Ann(1) @Ann(2) @Ann(3) private class A @Ann constructor() { @Ann(x = 5) fun foo() { 1 + @Ann(1) 1 * @Ann("") 6 diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt index d6a1e48a525..cb5c14da0f6 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt @@ -1,9 +1,9 @@ -fun foo(varargs f : Int) {} +fun foo(varargs f : Int) {} var bar : Int = 1 set(varargs v) {} val x : (Int) -> Int = {@varargs x : Int -> x} -class Hello(varargs args: Any) { +class Hello(varargs args: Any) { } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt index 9c84353aeca..2ee460f2704 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt @@ -1,12 +1,12 @@ @Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION) annotation class test -fun foo(test f : Int) {} +fun foo(@test f : Int) {} var bar : Int = 1 set(test v) {} val x : (Int) -> Int = {@test x : Int -> x} // todo fix parser annotation on lambda parameter -class Hello(test args: Any) { +class Hello(@test args: Any) { } diff --git a/compiler/testData/diagnostics/tests/annotations/migration/escapedModifiers.kt b/compiler/testData/diagnostics/tests/annotations/migration/escapedModifiers.kt new file mode 100644 index 00000000000..e9a65e0be99 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/migration/escapedModifiers.kt @@ -0,0 +1,27 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -NOT_YET_SUPPORTED_IN_INLINE +import kotlin.external as myNative +@annotation @data @public class Ann(val arg: Int = 1) + + +@inline @private fun bar(block: () -> Int) = block() + +@data class Q(val x: Int, val y: Int) + +fun bar2(): Array = null!! + +@open class A @private constructor(@private val prop: Int) { + @private val x = 1 + @inline fun foo(@noinline x: Int) { + @data class Local + + @inline fun localFun() {} + } + + @private object O1 {} + @public @companion object O2 {} +} + +kotlin.inline fun baz() { } +kotlin.data class Data + +myNative fun nativeFun(): Int diff --git a/compiler/testData/diagnostics/tests/annotations/migration/escapedModifiers.txt b/compiler/testData/diagnostics/tests/annotations/migration/escapedModifiers.txt new file mode 100644 index 00000000000..9aa5928cf09 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/migration/escapedModifiers.txt @@ -0,0 +1,60 @@ +package + +kotlin.inline() private fun bar(/*0*/ block: () -> kotlin.Int): kotlin.Int +public fun bar2(): kotlin.Array +kotlin.inline() public fun baz(): kotlin.Unit +kotlin.external() public fun nativeFun(): kotlin.Int + +public open class A { + private constructor A(/*0*/ prop: kotlin.Int) + private final val prop: kotlin.Int + private final val x: kotlin.Int = 1 + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + kotlin.inline() public final fun foo(/*0*/ kotlin.noinline() x: kotlin.Int): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + private object O1 { + private constructor O1() + 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 + } + + public companion object O2 { + private constructor O2() + 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 + } +} + +kotlin.annotation.annotation() kotlin.data() public final class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ arg: kotlin.Int = ...) + public final val arg: kotlin.Int + public final /*synthesized*/ fun component1(): kotlin.Int + public final /*synthesized*/ fun copy(/*0*/ arg: kotlin.Int = ...): Ann + 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 +} + +kotlin.data() public final class Data { + public constructor Data() + public final /*synthesized*/ fun copy(): Data + 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 +} + +kotlin.data() public final class Q { + public constructor Q(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int) + public final val x: kotlin.Int + public final val y: kotlin.Int + public final /*synthesized*/ fun component1(): kotlin.Int + public final /*synthesized*/ fun component2(): kotlin.Int + public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.Int = ...): Q + 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/annotations/migration/unescapedAnnotation.kt b/compiler/testData/diagnostics/tests/annotations/migration/unescapedAnnotation.kt new file mode 100644 index 00000000000..601b0baa69d --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/migration/unescapedAnnotation.kt @@ -0,0 +1,12 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE +annotation class Ann(val arg: Int = 1) + +Ann class A Ann constructor(Ann val prop: Int) { + Ann val x = 1 + Ann fun foo(Ann x: Int) {} + + Ann object O1 {} + Ann companion object O2 {} +} + +Ann object O3 {} diff --git a/compiler/testData/diagnostics/tests/annotations/migration/unescapedAnnotation.txt b/compiler/testData/diagnostics/tests/annotations/migration/unescapedAnnotation.txt new file mode 100644 index 00000000000..a68e2ff77e4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/migration/unescapedAnnotation.txt @@ -0,0 +1,40 @@ +package + +Ann() public final class A { + Ann() public constructor A(/*0*/ Ann() prop: kotlin.Int) + public final val prop: kotlin.Int + Ann() public final val x: kotlin.Int = 1 + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + Ann() public final fun foo(/*0*/ Ann() x: kotlin.Int): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + Ann() public object O1 { + private constructor O1() + 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 + } + + Ann() public companion object O2 { + private constructor O2() + 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 + } +} + +kotlin.annotation.annotation() public final class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ arg: kotlin.Int = ...) + public final val arg: 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 +} + +Ann() public object O3 { + private constructor O3() + 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/annotations/options/documented.kt b/compiler/testData/diagnostics/tests/annotations/options/documented.kt index b6012429caa..6b97984be50 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/documented.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/documented.kt @@ -3,6 +3,6 @@ annotation class DocAnn annotation class NotDocAnn -DocAnn class My +@DocAnn class My -NotDocAnn class Your +@NotDocAnn class Your diff --git a/compiler/testData/diagnostics/tests/annotations/options/javaDocumented.kt b/compiler/testData/diagnostics/tests/annotations/options/javaDocumented.kt index f861f90d306..3292157f7a0 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/javaDocumented.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/javaDocumented.kt @@ -13,8 +13,8 @@ public class DocumentedAnnotations { // FILE: DocumentedAnnotations.kt -DocumentedAnnotations.DocAnn class My +@DocumentedAnnotations.DocAnn class My -DocumentedAnnotations.NotDocAnn class Your +@DocumentedAnnotations.NotDocAnn class Your -DocumentedAnnotations.RunDocAnn class His +@DocumentedAnnotations.RunDocAnn class His diff --git a/compiler/testData/diagnostics/tests/annotations/options/javaretention.kt b/compiler/testData/diagnostics/tests/annotations/options/javaretention.kt index f15b34e170d..9da8584e996 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/javaretention.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/javaretention.kt @@ -26,10 +26,10 @@ public class AnnotationRetentions { // FILE: AnnotationRetentions.kt -AnnotationRetentions.BaseAnnotation class BaseClass +@AnnotationRetentions.BaseAnnotation class BaseClass -AnnotationRetentions.SourceAnnotation class SourceClass +@AnnotationRetentions.SourceAnnotation class SourceClass -AnnotationRetentions.BinaryAnnotation class BinaryClass +@AnnotationRetentions.BinaryAnnotation class BinaryClass -AnnotationRetentions.RuntimeAnnotation class RuntimeClass +@AnnotationRetentions.RuntimeAnnotation class RuntimeClass diff --git a/compiler/testData/diagnostics/tests/annotations/options/repeatable.kt b/compiler/testData/diagnostics/tests/annotations/options/repeatable.kt index 0b27b984202..b6e95dcf20a 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/repeatable.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/repeatable.kt @@ -17,13 +17,13 @@ annotation class binrepann @Repeatable annotation class repexpr -repann repann class DoubleAnnotated +@repann @repann class DoubleAnnotated -repann1(1) repann1(2) repann1(3) class TripleAnnotated +@repann1(1) @repann1(2) @repann1(3) class TripleAnnotated -repann2(true) repann2(false) repann2(false) repann2(true) class FourTimesAnnotated +@repann2(true) @repann2(false) @repann2(false) @repann2(true) class FourTimesAnnotated -binrepann binrepann class BinaryAnnotated +@binrepann @binrepann class BinaryAnnotated @repann @repann fun foo(@repann @repann x: Int): Int { @repexpr @repexpr return x diff --git a/compiler/testData/diagnostics/tests/annotations/options/retention.kt b/compiler/testData/diagnostics/tests/annotations/options/retention.kt index 74a9f80f8a9..2ea2d384d69 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/retention.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/retention.kt @@ -1,4 +1,4 @@ @Retention(AnnotationRetention.SOURCE) annotation class sourceann -sourceann class AnnotatedAtSource +@sourceann class AnnotatedAtSource diff --git a/compiler/testData/diagnostics/tests/annotations/options/target.kt b/compiler/testData/diagnostics/tests/annotations/options/target.kt index 4ffd9395901..489a1317d1a 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/target.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/target.kt @@ -1,5 +1,5 @@ @Target(AnnotationTarget.CLASSIFIER) annotation class base -base data class My +@base data class My diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/accessors.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/accessors.kt index 4e553bc8dc3..befd97855d5 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/accessors.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/accessors.kt @@ -8,9 +8,9 @@ annotation class smartset annotation class base class My(x: Int) { - smartget var y = x + @smartget var y = x @base @smartget @smartset get @base @smartget @smartset set - base smartget smartset fun foo() = y + @base @smartget @smartset fun foo() = y } diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/annotation.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/annotation.kt index cae63886e5b..6da9a55ee10 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/annotation.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/annotation.kt @@ -1,20 +1,20 @@ @Target(AnnotationTarget.ANNOTATION_CLASS) annotation class base -base annotation class derived +@base annotation class derived -base class correct(base val x: Int) { - base constructor(): this(0) +@base class correct(@base val x: Int) { + @base constructor(): this(0) } -base enum class My { +@base enum class My { @base FIRST, @base SECOND } -base fun foo(base y: @base Int): Int { - @base fun bar(base z: @base Int) = z + 1 +@base fun foo(@base y: @base Int): Int { + @base fun bar(@base z: @base Int) = z + 1 @base val local = bar(y) return local } -base val z = 0 +@base val z = 0 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/classifier.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/classifier.kt index b054b543ee7..cd28f0b8307 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/classifier.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/classifier.kt @@ -1,21 +1,21 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER @Target(AnnotationTarget.CLASSIFIER) annotation class base -base annotation class derived +@base annotation class derived -base class correct(base val x: Int, base w: @base Int) { - base constructor(): this(0, 0) +@base class correct(@base val x: Int, @base w: @base Int) { + @base constructor(): this(0, 0) } -base enum class My @base constructor() { +@base enum class My @base constructor() { @base FIRST, @base SECOND } -base fun foo(base y: @base Int): Int { - @base fun bar(base z: @base Int) = z + 1 +@base fun foo(@base y: @base Int): Int { + @base fun bar(@base z: @base Int) = z + 1 @base val local = bar(y) return local } -base val z = 0 +@base val z = 0 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/constructor.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/constructor.kt index bfc080fcce7..c08fe661587 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/constructor.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/constructor.kt @@ -1,20 +1,20 @@ @Target(AnnotationTarget.CONSTRUCTOR) annotation class base -base annotation class derived +@base annotation class derived -base class correct(base val x: Int) { - base constructor(): this(0) +@base class correct(@base val x: Int) { + @base constructor(): this(0) } -base enum class My @base constructor() { +@base enum class My @base constructor() { @base FIRST, @base SECOND } -base fun foo(base y: @base Int): Int { - @base fun bar(base z: @base Int) = z + 1 +@base fun foo(@base y: @base Int): Int { + @base fun bar(@base z: @base Int) = z + 1 @base val local = bar(y) return local } -base val z = 0 +@base val z = 0 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/empty.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/empty.kt index 2e1b58b1bd2..be3b5682d8f 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/empty.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/empty.kt @@ -1,21 +1,21 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER @Target() annotation class empty -empty annotation class derived +@empty annotation class derived -empty class correct(empty val x: Int, empty w: @empty Int) { - empty constructor(): this(0, 0) +@empty class correct(@empty val x: Int, @empty w: @empty Int) { + @empty constructor(): this(0, 0) } -empty enum class My @empty constructor() { +@empty enum class My @empty constructor() { @empty FIRST, @empty SECOND } -empty fun foo(empty y: @empty Int): Int { - @empty fun bar(empty z: @empty Int) = z + 1 +@empty fun foo(@empty y: @empty Int): Int { + @empty fun bar(@empty z: @empty Int) = z + 1 @empty val local = bar(y) return local } -empty val z = @empty 0 +@empty val z = @empty 0 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/expr.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/expr.kt index 97c831d9ea9..156e175b619 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/expr.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/expr.kt @@ -4,7 +4,7 @@ annotation class base fun transform(i: Int, tr: (Int) -> Int): Int = @base @special tr(@special i) -base special fun foo(i: Int): Int { +@base @special fun foo(i: Int): Int { val j = @base @special i + 1 if (j == 1) return foo(@special @base 42) return transform(@special j, @base @special { @special it * 2 }) diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/file.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/file.kt index cdd207e8249..1a35394f546 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/file.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/file.kt @@ -12,7 +12,7 @@ annotation class common package test -special class Incorrect +@special class Incorrect // FILE: another.kt @@ -20,4 +20,4 @@ package test package test -common class Correct +@common class Correct diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/function.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/function.kt index 31001806ef2..e019bee39c7 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/function.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/function.kt @@ -1,22 +1,22 @@ @Target(AnnotationTarget.FUNCTION) annotation class base -base annotation class derived +@base annotation class derived -base class correct(base val x: Int) { - base constructor(): this(0) +@base class correct(@base val x: Int) { + @base constructor(): this(0) - base public fun baz() {} + @base public fun baz() {} } -base enum class My @base constructor() { +@base enum class My @base constructor() { @base FIRST, @base SECOND } -base fun foo(base y: @base Int): Int { - @base fun bar(base z: @base Int) = z + 1 +@base fun foo(@base y: @base Int): Int { + @base fun bar(@base z: @base Int) = z + 1 @base val local = bar(y) return local } -base val z = 0 \ No newline at end of file +@base val z = 0 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/incorrect.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/incorrect.kt index 364f572f93f..5cfa806c340 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/incorrect.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/incorrect.kt @@ -1,21 +1,21 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER @Target(AnnotationTarget.INIT) annotation class incorrect -incorrect annotation class derived +@incorrect annotation class derived -incorrect class correct(incorrect val x: Int, incorrect w: @incorrect Int) { - incorrect constructor(): this(0, 0) +@incorrect class correct(@incorrect val x: Int, @incorrect w: @incorrect Int) { + @incorrect constructor(): this(0, 0) } -incorrect enum class My @incorrect constructor() { +@incorrect enum class My @incorrect constructor() { @incorrect FIRST, @incorrect SECOND } -incorrect fun foo(incorrect y: @incorrect Int): Int { - @incorrect fun bar(incorrect z: @incorrect Int) = z + 1 +@incorrect fun foo(@incorrect y: @incorrect Int): Int { + @incorrect fun bar(@incorrect z: @incorrect Int) = z + 1 @incorrect val local = bar(y) return local } -incorrect val z = @incorrect 0 +@incorrect val z = @incorrect 0 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/init.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/init.kt index e87e08a03a1..a213d178a1d 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/init.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/init.kt @@ -1,6 +1,6 @@ annotation class base -base class My { +@base class My { @base init { } } diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/java.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/java.kt index 9a52adcb200..c3ebd37f28a 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/java.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/java.kt @@ -60,16 +60,16 @@ package test import test.AnnotationTargets.* -base meta type konstructor annotation class KMeta +@base @meta @type @konstructor annotation class KMeta -base meta type method multiple class KClass( +@base @meta @type @method @multiple class KClass( @base @fieldann @parameter val y: @base @type Int) { - base multiple fieldann local val x = 0 + @base @multiple @fieldann @local val x = 0 @method @konstructor @type get - base method multiple konstructor + @base @method @multiple @konstructor fun foo(@parameter @type i: @base @multiple Int ): @fieldann @parameter Int { @@ -78,5 +78,5 @@ base meta type method@base @multiple return j } - base method konstructor constructor(): this(0) + @base @method @konstructor constructor(): this(0) } diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/local.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/local.kt index b67e7ec4c07..9b158213996 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/local.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/local.kt @@ -1,20 +1,20 @@ @Target(AnnotationTarget.LOCAL_VARIABLE) annotation class base -base annotation class derived +@base annotation class derived -base class correct(base val x: Int) { - base constructor(): this(0) +@base class correct(@base val x: Int) { + @base constructor(): this(0) } -base enum class My { +@base enum class My { @base FIRST, @base SECOND } -base fun foo(base y: @base Int): Int { - @base fun bar(base z: @base Int) = z + 1 +@base fun foo(@base y: @base Int): Int { + @base fun bar(@base z: @base Int) = z + 1 @base val local = bar(y) return local } -base val z = 0 +@base val z = 0 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/nested.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/nested.kt index 3e1b922a6b6..33c996616b6 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/nested.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/nested.kt @@ -4,10 +4,10 @@ annotation class base @Target(AnnotationTarget.ANNOTATION_CLASS) annotation class meta -base class Outer { - base meta class Nested +@base class Outer { + @base @meta class Nested - base meta annotation class Annotated + @base @meta annotation class Annotated fun foo() { @base @meta class Local diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/property.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/property.kt index df3d44846b0..7a76166d837 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/property.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/property.kt @@ -1,21 +1,21 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER @Target(AnnotationTarget.PROPERTY) annotation class base -base annotation class derived +@base annotation class derived -base class correct(base val x: Int, base w: Int) { - base constructor(): this(0, 0) +@base class correct(@base val x: Int, @base w: Int) { + @base constructor(): this(0, 0) } -base enum class My { +@base enum class My { @base FIRST, @base SECOND } -base fun foo(base y: @base Int): Int { - @base fun bar(base z: @base Int) = z + 1 +@base fun foo(@base y: @base Int): Int { + @base fun bar(@base z: @base Int) = z + 1 @base val local = bar(y) return local } -base val z = 0 +@base val z = 0 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/returntype.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/returntype.kt index 7eefdbe48f2..bbb615faefe 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/returntype.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/returntype.kt @@ -3,7 +3,7 @@ annotation class base @Target(AnnotationTarget.TYPE) annotation class typed -base class My(val x: @base @typed Int, y: @base @typed Int) { +@base class My(val x: @base @typed Int, y: @base @typed Int) { val z: @base @typed Int = y fun foo(): @base @typed Int = z } diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/type.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/type.kt index 5fedf5c3ebe..ebe9314228e 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/type.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/type.kt @@ -1,20 +1,20 @@ @Target(AnnotationTarget.TYPE) annotation class base -base annotation class derived +@base annotation class derived -base class correct(base val x: @base Int) { - base constructor(): this(0) +@base class correct(@base val x: @base Int) { + @base constructor(): this(0) } -base enum class My @base constructor() { +@base enum class My @base constructor() { @base FIRST, @base SECOND } -base fun foo(base y: @base Int): Int { - @base fun bar(base z: @base Int) = z + 1 +@base fun foo(@base y: @base Int): Int { + @base fun bar(@base z: @base Int) = z + 1 @base val local = bar(y) return local } -base val z = 0 +@base val z = 0 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.kt index d0cbff6a839..2fe05bf5d97 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.kt @@ -1,21 +1,21 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER @Target(AnnotationTarget.VALUE_PARAMETER) annotation class base -base annotation class derived +@base annotation class derived -base class correct(base val x: Int, base w: Int) { - base constructor(): this(0, 0) +@base class correct(@base val x: Int, @base w: Int) { + @base constructor(): this(0, 0) } -base enum class My { +@base enum class My { @base FIRST, @base SECOND } -base fun foo(base y: @base Int): Int { - @base fun bar(base z: @base Int) = z + 1 +@base fun foo(@base y: @base Int): Int { + @base fun bar(@base z: @base Int) = z + 1 @base val local = bar(y) return local } -base val z = 0 +@base val z = 0 diff --git a/compiler/testData/diagnostics/tests/annotations/options/unrepeatable.kt b/compiler/testData/diagnostics/tests/annotations/options/unrepeatable.kt index 7a9eb0fe2b5..56318cf3d12 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/unrepeatable.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/unrepeatable.kt @@ -2,12 +2,12 @@ annotation class unrepann(val x: Int) annotation class ann(val y: Int) -unrepann(1) unrepann(2) class DoubleAnnotated +@unrepann(1) @unrepann(2) class DoubleAnnotated -ann(3) ann(7) ann(42) class TripleAnnotated +@ann(3) @ann(7) @ann(42) class TripleAnnotated @Target(AnnotationTarget.EXPRESSION) annotation class annexpr -ann(0) ann(1) fun foo(@ann(7) @ann(2) x: Int): Int { +@ann(0) @ann(1) fun foo(@ann(7) @ann(2) x: Int): Int { @annexpr @annexpr return x } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/unresolvedReferenceRange.kt b/compiler/testData/diagnostics/tests/annotations/unresolvedReferenceRange.kt index 04d2055cc99..2f6867c828f 100644 --- a/compiler/testData/diagnostics/tests/annotations/unresolvedReferenceRange.kt +++ b/compiler/testData/diagnostics/tests/annotations/unresolvedReferenceRange.kt @@ -1,3 +1,3 @@ @Ann class A -Ann class B -@Ann(1) class C +@Ann class B +@Ann(1) class C \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.kt b/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.kt index 8777bd214f2..4df483c4293 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.kt @@ -6,14 +6,14 @@ interface B fun () {} fun A.() {} -a fun () {} +@a fun () {} fun @a A.() {} class Outer { fun () {} fun B.() {} - a fun () {} + @a fun () {} fun @a A.() {} } diff --git a/compiler/testData/diagnostics/tests/deprecated/annotationUsage.kt b/compiler/testData/diagnostics/tests/deprecated/annotationUsage.kt index 09b7fdcd35d..286e0580417 100644 --- a/compiler/testData/diagnostics/tests/deprecated/annotationUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/annotationUsage.kt @@ -1,9 +1,9 @@ -Deprecated("text") +@Deprecated("text") annotation class obsolete() -Deprecated("text") +@Deprecated("text") annotation class obsoleteWithParam(val text: String) -obsolete class Obsolete +@obsolete class Obsolete -obsoleteWithParam("text") class Obsolete2 \ No newline at end of file +@obsoleteWithParam("text") class Obsolete2 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deprecated/componentUsage.kt b/compiler/testData/diagnostics/tests/deprecated/componentUsage.kt index 6272056e331..833ec310286 100644 --- a/compiler/testData/diagnostics/tests/deprecated/componentUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/componentUsage.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE class Data { - Deprecated("text") + @Deprecated("text") fun component1(): String = throw Exception() fun component2(): String = throw Exception() } diff --git a/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt b/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt index b2e41869cb7..f35803a34db 100644 --- a/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt @@ -4,15 +4,15 @@ class UsefulClass(val param: Int = 2) { fun get(instance: Any, property: PropertyMetadata) : Int = 1 fun set(instance: Any, property: PropertyMetadata, value: Int) {} - Deprecated("message") + @Deprecated("message") fun member() {} } -Deprecated("message") +@Deprecated("message") fun Obsolete(param: Int = 1): UsefulClass = UsefulClass(param) class Invocable { - Deprecated("message") + @Deprecated("message") fun invoke() {} } @@ -40,7 +40,7 @@ class Initializer { val x = Obsolete() } -Deprecated("does nothing good") +@Deprecated("does nothing good") fun Any.doNothing() = this.toString() // "this" should not be marked as deprecated despite it referes to deprecated function class Delegation { diff --git a/compiler/testData/diagnostics/tests/deprecated/genericConstructorUsage.kt b/compiler/testData/diagnostics/tests/deprecated/genericConstructorUsage.kt index 0dca6106452..5c1feef730b 100644 --- a/compiler/testData/diagnostics/tests/deprecated/genericConstructorUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/genericConstructorUsage.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION, -UNUSED_PARAMETER open class C() { - Deprecated("") + @Deprecated("") constructor(p: Int) : this(){} } diff --git a/compiler/testData/diagnostics/tests/deprecated/imports.kt b/compiler/testData/diagnostics/tests/deprecated/imports.kt index 870638baa0c..f203536c3c3 100644 --- a/compiler/testData/diagnostics/tests/deprecated/imports.kt +++ b/compiler/testData/diagnostics/tests/deprecated/imports.kt @@ -1,6 +1,6 @@ import C as C2 -Deprecated("obsolete") +@Deprecated("obsolete") class C { fun use() {} } diff --git a/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.kt b/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.kt index 807a319b772..d524e270402 100644 --- a/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.kt @@ -1,5 +1,5 @@ class Iter { - Deprecated("text") + @Deprecated("text") fun iterator() : IterIterator = throw Exception() class IterIterator { @@ -11,9 +11,9 @@ class Iter { class Iter2 { fun iterator() : Iter2Iterator = throw Exception() class Iter2Iterator { - Deprecated("text") + @Deprecated("text") fun hasNext(): Boolean = throw UnsupportedOperationException() - Deprecated("text") + @Deprecated("text") fun next(): String = throw UnsupportedOperationException() } } diff --git a/compiler/testData/diagnostics/tests/deprecated/nestedTypesUsage.kt b/compiler/testData/diagnostics/tests/deprecated/nestedTypesUsage.kt index 8201caf69e6..acc96d7eaec 100644 --- a/compiler/testData/diagnostics/tests/deprecated/nestedTypesUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/nestedTypesUsage.kt @@ -1,5 +1,5 @@ class TopLevel { - Deprecated("Nested") + @Deprecated("Nested") class Nested { companion object { fun use() {} diff --git a/compiler/testData/diagnostics/tests/deprecated/objectUsage.kt b/compiler/testData/diagnostics/tests/deprecated/objectUsage.kt index c1012c43198..406bd1c86b5 100644 --- a/compiler/testData/diagnostics/tests/deprecated/objectUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/objectUsage.kt @@ -1,10 +1,10 @@ -Deprecated("Object") +@Deprecated("Object") object Obsolete { fun use() {} } class Another { - Deprecated("Object") + @Deprecated("Object") companion object { fun use() {} } diff --git a/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt b/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt index 07f4e9a87b3..36d8b3eea08 100644 --- a/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt @@ -1,18 +1,18 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION class Delegate() { - Deprecated("text") + @Deprecated("text") fun get(instance: Any, property: PropertyMetadata) : Int = 1 - Deprecated("text") + @Deprecated("text") fun set(instance: Any, property: PropertyMetadata, value: Int) {} } class PropertyHolder { - Deprecated("text") + @Deprecated("text") val x = 1 - Deprecated("text") + @Deprecated("text") var name = "String" val valDelegate by Delegate() diff --git a/compiler/testData/diagnostics/tests/deprecated/propertyUseSiteTargetedAnnotations.kt b/compiler/testData/diagnostics/tests/deprecated/propertyUseSiteTargetedAnnotations.kt index addfe06e8e0..b5fb8c11012 100644 --- a/compiler/testData/diagnostics/tests/deprecated/propertyUseSiteTargetedAnnotations.kt +++ b/compiler/testData/diagnostics/tests/deprecated/propertyUseSiteTargetedAnnotations.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION class PropertyHolder { - Deprecated("") + @Deprecated("") val a1 = 1 @property:Deprecated("") diff --git a/compiler/testData/diagnostics/tests/deprecated/typeUsage.kt b/compiler/testData/diagnostics/tests/deprecated/typeUsage.kt index 8490c04638c..d85690113c2 100644 --- a/compiler/testData/diagnostics/tests/deprecated/typeUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/typeUsage.kt @@ -1,10 +1,10 @@ -Deprecated("Class") +@Deprecated("Class") open class Obsolete { fun use() {} } -Deprecated("Class") -open class Obsolete2 Deprecated("Constructor") constructor() { +@Deprecated("Class") +open class Obsolete2 @Deprecated("Constructor") constructor() { fun use() {} } diff --git a/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.kt b/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.kt index 4dc5ed2ddd2..9df96f3cbf9 100644 --- a/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.kt +++ b/compiler/testData/diagnostics/tests/enum/modifiersOnEnumEntry.kt @@ -14,7 +14,7 @@ enum class E { final FINAL, inner INNER, - @annotation ANNOTATION, + annotation ANNOTATION, enum ENUM, out OUT, in IN, diff --git a/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt b/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt index 051386ea5fc..46af506ac30 100644 --- a/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt +++ b/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt @@ -12,6 +12,6 @@ val a8 = 1.div(a2) val a9 = 2 * (1.div(0)) val b1: Byte = 1 / 0 -Ann(1 / 0) val b2 = 1 +@Ann(1 / 0) val b2 = 1 annotation class Ann(val i : Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/localFun.kt b/compiler/testData/diagnostics/tests/inline/localFun.kt index ef75045210a..9b121f25570 100644 --- a/compiler/testData/diagnostics/tests/inline/localFun.kt +++ b/compiler/testData/diagnostics/tests/inline/localFun.kt @@ -1,4 +1,4 @@ fun main(args: Array) { - @inline fun a(){ + inline fun a(){ } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/anonymousObjects.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/anonymousObjects.kt index 9b68c80e041..f0511f047de 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/anonymousObjects.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/anonymousObjects.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE import kotlin.InlineOption.* -inline fun inlineFunOnlyLocal(inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { +inline fun inlineFunOnlyLocal(@inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { val s = object { val z = p() diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/anonymousObjectsNested.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/anonymousObjectsNested.kt index 0283fb87be7..c040ccc889b 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/anonymousObjectsNested.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/anonymousObjectsNested.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE import kotlin.InlineOption.* -inline fun inlineFunOnlyLocal(inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { +inline fun inlineFunOnlyLocal(@inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { val s = object { val z = p(); diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.kt index b4496e3aaad..76ba42241bd 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.kt @@ -1,6 +1,6 @@ import kotlin.InlineOption.* -inline fun onlyLocal(inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { +inline fun onlyLocal(@inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { inlineAll(p) } diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.kt index 575faa44a26..c46e465888d 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.kt @@ -1,6 +1,6 @@ import kotlin.InlineOption.* -inline fun inlineFunWithAnnotation(inlineOptions(ONLY_LOCAL_RETURN) p: () -> R) { +inline fun inlineFunWithAnnotation(@inlineOptions(ONLY_LOCAL_RETURN) p: () -> R) { inlineFun { p() } diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/lambdaWithGlobalReturnsInsideOnlyLocalOne.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/lambdaWithGlobalReturnsInsideOnlyLocalOne.kt index 299bd3444b7..97fb3c87819 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/lambdaWithGlobalReturnsInsideOnlyLocalOne.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/lambdaWithGlobalReturnsInsideOnlyLocalOne.kt @@ -5,6 +5,6 @@ inline fun testSameCaptured(lambdaWithResultCaptured: () -> Unit) : String { return "OK" } -inline fun doWork(inlineOptions(ONLY_LOCAL_RETURN) job: ()-> R) : R { +inline fun doWork(@inlineOptions(ONLY_LOCAL_RETURN) job: ()-> R) : R { return job() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/localFun.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/localFun.kt index 0bc05e4d922..c108ed02e30 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/localFun.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/localFun.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE import kotlin.InlineOption.* -inline fun inlineFunOnlyLocal(inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { +inline fun inlineFunOnlyLocal(@inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { fun a() { val z = p() } diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/noInlineLambda.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/noInlineLambda.kt index bf3b350c7d8..dafb752e6ae 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/noInlineLambda.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/noInlineLambda.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE import kotlin.InlineOption.* -inline fun inlineFunOnlyLocal(inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { +inline fun inlineFunOnlyLocal(@inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { { p() }() diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nonInlinedClass.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nonInlinedClass.kt index a382798aca5..b6c64452db5 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nonInlinedClass.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nonInlinedClass.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE import kotlin.InlineOption.* -inline fun inlineFunOnlyLocal(inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { +inline fun inlineFunOnlyLocal(@inlineOptions(ONLY_LOCAL_RETURN)p: () -> R) { class A { val z = p() diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambda.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambda.kt index 98e99ba17f1..67855cffff7 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambda.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambda.kt @@ -39,6 +39,6 @@ fun fun4ValueArgument(p: () -> R) { } -inline fun inlineFun(inlineOptions(ONLY_LOCAL_RETURN) p: () -> R) { +inline fun inlineFun(@inlineOptions(ONLY_LOCAL_RETURN) p: () -> R) { p() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambdaBinaryExpr.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambdaBinaryExpr.kt index d6fc9938e25..eeaa087d347 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambdaBinaryExpr.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambdaBinaryExpr.kt @@ -2,7 +2,7 @@ import kotlin.InlineOption.* class Z { - inline fun inlineFun(inlineOptions(ONLY_LOCAL_RETURN) p: () -> R) { + inline fun inlineFun(@inlineOptions(ONLY_LOCAL_RETURN) p: () -> R) { p() } } diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/toOnlyLocal.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/toOnlyLocal.kt index 71b69583e83..80aac4dc372 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/toOnlyLocal.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/toOnlyLocal.kt @@ -1,6 +1,6 @@ import kotlin.InlineOption.* -inline fun toOnlyLocal(inlineOptions(ONLY_LOCAL_RETURN) p: () -> R) { +inline fun toOnlyLocal(@inlineOptions(ONLY_LOCAL_RETURN) p: () -> R) { p() } diff --git a/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass2.kt b/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass2.kt index 1cb8fc0ca75..c77f9cbccee 100644 --- a/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass2.kt +++ b/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass2.kt @@ -6,7 +6,7 @@ public fun test() { } } - @inline fun localFun2() { + inline fun localFun2() { Z().localFun() } diff --git a/compiler/testData/diagnostics/tests/inline/nonPublicMember/localFun.kt b/compiler/testData/diagnostics/tests/inline/nonPublicMember/localFun.kt index 2ee86c0a7c9..ccb0c0e7e93 100644 --- a/compiler/testData/diagnostics/tests/inline/nonPublicMember/localFun.kt +++ b/compiler/testData/diagnostics/tests/inline/nonPublicMember/localFun.kt @@ -4,7 +4,7 @@ public fun test() { } - @inline fun localFun2() { + inline fun localFun2() { localFun() } diff --git a/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.kt b/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.kt index a1282a06801..4fd4fe0b22d 100644 --- a/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.kt +++ b/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.kt @@ -27,7 +27,7 @@ class FinalClass() { annotation class annotated(val text: String = "not given") //Check legal modifiers in constructor -class LegalModifier(val a: Int, annotated private var b: String, annotated vararg v: Int) +class LegalModifier(val a: Int, @annotated private var b: String, @annotated vararg v: Int) //Check illegal modifier in constructor parameters class IllegalModifiers1( @@ -43,10 +43,10 @@ class IllegalModifiers2(private public abstract b: String) +class IllegalModifiers3(@annotated public abstract b: String) //Check annotations and vararg with illegal modifiers in constructor -class IllegalModifiers4(val a: Int, annotated("a text") protected vararg v: Int) +class IllegalModifiers4(val a: Int, @annotated("a text") protected vararg v: Int) //Check illegal modifiers for functions and catch block abstract class IllegalModifiers5() { @@ -58,7 +58,7 @@ abstract class IllegalModifiers5() { abstract fun bar(public abstract a: Int, vararg v: String) //Check annotations with illegal modifiers - abstract fun baz(annotated("a text") public abstract a: Int) + abstract fun baz(@annotated("a text") public abstract a: Int) private fun qux() { @@ -69,7 +69,7 @@ abstract class IllegalModifiers5() { try {} catch (in out reified enum abstract public e: Exception) {} //Check annotations with illegal modifiers - try {} catch (annotated("a text") abstract public e: Exception) {} + try {} catch (@annotated("a text") abstract public e: Exception) {} } } diff --git a/compiler/testData/diagnostics/tests/modifiers/primaryConstructorMissingKeyword.kt b/compiler/testData/diagnostics/tests/modifiers/primaryConstructorMissingKeyword.kt index 2999a436965..a6771d2e4f3 100644 --- a/compiler/testData/diagnostics/tests/modifiers/primaryConstructorMissingKeyword.kt +++ b/compiler/testData/diagnostics/tests/modifiers/primaryConstructorMissingKeyword.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER annotation class Ann(val x: Int = 1) class A private (val x: Int) { -inner class B Ann(2) (val y: Int) +inner class B @Ann(2) (val y: Int) fun foo() { class C private @Ann(3) (args: Int) diff --git a/compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.kt b/compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.kt index 3bc49b3d21c..86e395e8dbd 100644 --- a/compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.kt +++ b/compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.kt @@ -8,5 +8,5 @@ public @interface A { // FILE: 1.kt -A(x = 1, y = "2") +@A(x = 1, y = "2") fun test() {} diff --git a/compiler/testData/diagnostics/tests/regressions/ea65509.kt b/compiler/testData/diagnostics/tests/regressions/ea65509.kt index 23451feb595..8c919315f19 100644 --- a/compiler/testData/diagnostics/tests/regressions/ea65509.kt +++ b/compiler/testData/diagnostics/tests/regressions/ea65509.kt @@ -1,5 +1,5 @@ // !DIAGNOSTICS: -FUNCTION_DECLARATION_WITH_NO_NAME class ClassB() { - private inner class ClassC: super.ClassA() { + private inner class ClassC: super.@ClassA() { } } diff --git a/compiler/testData/diagnostics/tests/regressions/ea66984.kt b/compiler/testData/diagnostics/tests/regressions/ea66984.kt index 054e4f5330d..07c3760a1f4 100644 --- a/compiler/testData/diagnostics/tests/regressions/ea66984.kt +++ b/compiler/testData/diagnostics/tests/regressions/ea66984.kt @@ -1,2 +1,2 @@ // !DIAGNOSTICS: -NO_VALUE_FOR_PARAMETER -class Tree(T element, Tree left, Tree right) {} \ No newline at end of file +class Tree(T element, Tree left, Tree right) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/ctrsAnnotationResolve.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/ctrsAnnotationResolve.kt index da64820316a..9e77c08483a 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/ctrsAnnotationResolve.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/ctrsAnnotationResolve.kt @@ -3,7 +3,10 @@ annotation class Ann1 annotation class Ann2(val x: Int) class A { - Ann1 constructor() - Ann2 constructor(x1: Int) - Ann2(2) constructor(x1: Int, x2: Int) + @Ann1 + constructor() + @Ann2 + constructor(x1: Int) + @Ann2(2) + constructor(x1: Int, x2: Int) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalNativeClassMembers.kt index e6b39c62cc5..a161a8a40db 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalNativeClassMembers.kt @@ -3,46 +3,46 @@ fun foo() { @native class A { - nativeGetter + @nativeGetter fun get(a: String): Any? = null - nativeGetter + @nativeGetter fun take(a: Number): String? = null - nativeGetter + @nativeGetter fun foo(a: Double): String? = null } @native class B { - nativeGetter + @nativeGetter val foo = 0 } @native class C { - nativeGetter + @nativeGetter fun Int.get(a: String): Int? = 1 - nativeGetter + @nativeGetter fun Int.get2(a: Number): String? = "OK" - nativeGetter + @nativeGetter fun Int.get3(a: Int): String? = "OK" - nativeGetter + @nativeGetter fun get(): Any? = null - nativeGetter + @nativeGetter fun get(a: A): Any? = null - nativeGetter + @nativeGetter fun foo(a: Int) {} - nativeGetter + @nativeGetter fun bar(a: String): Int = 0 - nativeGetter + @nativeGetter fun baz(a: String = "foo"): Int? = 0 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalNonNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalNonNativeClassMembers.kt index 1973c5398e3..4f0a78271f3 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalNonNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalNonNativeClassMembers.kt @@ -2,44 +2,44 @@ fun foo() { class A { - nativeGetter + @nativeGetter fun get(a: String): Any? = null - nativeGetter + @nativeGetter fun take(a: Number): String? = null - nativeGetter + @nativeGetter fun foo(a: Double): String? = null } class B { - nativeGetter + @nativeGetter val foo = 0 } class C { - nativeGetter + @nativeGetter fun Int.get(a: String): Int? = 1 - nativeGetter + @nativeGetter fun Int.get2(a: Number): String? = "OK" - nativeGetter + @nativeGetter fun Int.get3(a: Int): String? = "OK" - nativeGetter + @nativeGetter fun get(): Any? = null - nativeGetter + @nativeGetter fun get(a: A): Any? = null - nativeGetter + @nativeGetter fun foo(a: Int) {} - nativeGetter + @nativeGetter fun bar(a: String): Int = 0 - nativeGetter + @nativeGetter fun baz(a: Int = 0): Int? = 0 } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNativeClassMembers.kt index 75bf9a0b664..86d81316a79 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNativeClassMembers.kt @@ -1,79 +1,79 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -native +@native class A { - nativeGetter + @nativeGetter fun get(a: String): Any? = null - nativeGetter + @nativeGetter fun take(a: Number): String? = null - nativeGetter + @nativeGetter fun foo(a: Double): String? = null companion object { - nativeGetter + @nativeGetter fun get(a: String): Any? = null - nativeGetter + @nativeGetter fun take(a: Number): String? = null - nativeGetter + @nativeGetter fun foo(a: Double): String? = null } } -native +@native class B { - nativeGetter + @nativeGetter val foo = 0 - nativeGetter + @nativeGetter object Obj1 {} companion object { - nativeGetter + @nativeGetter val foo = 0 - nativeGetter + @nativeGetter object Obj2 {} } } -native +@native class C { - nativeGetter + @nativeGetter fun Int.get(a: String): Int? = 1 - nativeGetter + @nativeGetter fun Int.get2(a: Number): String? = "OK" - nativeGetter + @nativeGetter fun Int.get3(a: Int): String? = "OK" - nativeGetter + @nativeGetter fun get(): Any? = null - nativeGetter + @nativeGetter fun get(a: A): Any? = null - nativeGetter + @nativeGetter fun foo(a: Int) {} - nativeGetter + @nativeGetter fun bar(a: String): Int = 0 - nativeGetter + @nativeGetter fun baz(a: String = "foo"): Int? = 0 companion object { - nativeGetter + @nativeGetter fun Int.get(a: String): Int? = 1 - nativeGetter + @nativeGetter fun Int.get2(a: Number): String? = "OK" - nativeGetter + @nativeGetter fun Int.get3(a: Int): String? = "OK" } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNestedDeclarationsInsideNativeClass.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNestedDeclarationsInsideNativeClass.kt index 9d8fbd27c0c..3efa0c16690 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNestedDeclarationsInsideNativeClass.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNestedDeclarationsInsideNativeClass.kt @@ -1,121 +1,121 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -native +@native class A { class B { class A { - nativeGetter + @nativeGetter fun get(a: String): Any? = null - nativeGetter + @nativeGetter fun take(a: Number): String? = null - nativeGetter + @nativeGetter fun foo(a: Double): String? = null companion object { - nativeGetter + @nativeGetter fun get(a: String): Any? = null - nativeGetter + @nativeGetter fun take(a: Number): String? = null - nativeGetter + @nativeGetter fun foo(a: Double): String? = null } } class B { - nativeGetter + @nativeGetter val foo = 0 - nativeGetter + @nativeGetter object Obj1 {} companion object { - nativeGetter + @nativeGetter val foo = 0 - nativeGetter + @nativeGetter object Obj2 {} } } class C { - nativeGetter + @nativeGetter fun Int.get(a: String): Int? = 1 - nativeGetter + @nativeGetter fun Int.get2(a: Number): String? = "OK" - nativeGetter + @nativeGetter fun Int.get3(a: Int): String? = "OK" - nativeGetter + @nativeGetter fun get(): Any? = null - nativeGetter + @nativeGetter fun get(a: A): Any? = null - nativeGetter + @nativeGetter fun foo(a: Int) {} - nativeGetter + @nativeGetter fun bar(a: String): Int = 0 - nativeGetter + @nativeGetter fun baz(a: Number = 1.1): Int? = 0 } object obj { - nativeGetter + @nativeGetter fun Int.get(a: String): Int? = 1 - nativeGetter + @nativeGetter fun Int.get2(a: Number): String? = "OK" - nativeGetter + @nativeGetter fun Int.get3(a: Int): String? = "OK" - nativeGetter + @nativeGetter fun get(): Any? = null - nativeGetter + @nativeGetter fun get(a: A): Any? = null - nativeGetter + @nativeGetter fun foo(a: Int) {} - nativeGetter + @nativeGetter fun bar(a: String): Int = 0 - nativeGetter + @nativeGetter fun baz(a: String = "foo"): Int? = 0 } val anonymous = object { - nativeGetter + @nativeGetter fun Int.get(a: String): Int? = 1 - nativeGetter + @nativeGetter fun Int.get2(a: Number): String? = "OK" - nativeGetter + @nativeGetter fun Int.get3(a: Int): String? = "OK" - nativeGetter + @nativeGetter fun get(): Any? = null - nativeGetter + @nativeGetter fun get(a: A): Any? = null - nativeGetter + @nativeGetter fun foo(a: Int) {} - nativeGetter + @nativeGetter fun bar(a: String): Int = 0 - nativeGetter + @nativeGetter fun baz(a: String = "foo"): Int? = 0 } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNestedDeclarationsInsideNonNativeClass.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNestedDeclarationsInsideNonNativeClass.kt index ebafa30496d..7452d77a2ff 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNestedDeclarationsInsideNonNativeClass.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNestedDeclarationsInsideNonNativeClass.kt @@ -3,109 +3,109 @@ class A { class B { class A { - nativeGetter + @nativeGetter fun get(a: String): Any? = null - nativeGetter + @nativeGetter fun take(a: Number): String? = null - nativeGetter + @nativeGetter fun foo(a: Double): String? = null companion object { - nativeGetter + @nativeGetter fun get(a: String): Any? = null - nativeGetter + @nativeGetter fun take(a: Number): String? = null - nativeGetter + @nativeGetter fun foo(a: Double): String? = null } } class B { - nativeGetter + @nativeGetter fun Int.get(a: String): Int? = 1 - nativeGetter + @nativeGetter fun Int.get2(a: Number): String? = "OK" - nativeGetter + @nativeGetter fun Int.get3(a: Int): String? = "OK" - nativeGetter + @nativeGetter val foo = 0 - nativeGetter + @nativeGetter object Obj1 {} companion object { - nativeGetter + @nativeGetter val foo = 0 - nativeGetter + @nativeGetter object Obj2 {} - nativeGetter + @nativeGetter fun Int.get(a: String): Int? = 1 - nativeGetter + @nativeGetter fun Int.get2(a: Number): String? = "OK" - nativeGetter + @nativeGetter fun Int.get3(a: Int): String? = "OK" } } class C { - nativeGetter + @nativeGetter fun get(): Any? = null - nativeGetter + @nativeGetter fun get(a: A): Any? = null - nativeGetter + @nativeGetter fun foo(a: Int) {} - nativeGetter + @nativeGetter fun bar(a: String): Int = 0 - nativeGetter + @nativeGetter fun baz(a: String = "foo"): Int? = 0 } object obj { - nativeGetter + @nativeGetter fun get(): Any? = null - nativeGetter + @nativeGetter fun get(a: A): Any? = null - nativeGetter + @nativeGetter fun foo(a: Int) {} - nativeGetter + @nativeGetter fun bar(a: String): Int = 0 - nativeGetter + @nativeGetter fun baz(a: Double = 0.0): Int? = 0 } val anonymous = object { - nativeGetter + @nativeGetter fun get(): Any? = null - nativeGetter + @nativeGetter fun get(a: A): Any? = null - nativeGetter + @nativeGetter fun foo(a: Int) {} - nativeGetter + @nativeGetter fun bar(a: String): Int = 0 - nativeGetter + @nativeGetter fun baz(a: String = "foo"): Int? = 0 } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNonNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNonNativeClassMembers.kt index a52d3fe3bfc..6603a3037c0 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNonNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onNonNativeClassMembers.kt @@ -1,65 +1,65 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER class A { - nativeGetter + @nativeGetter fun get(a: String): Any? = null - nativeGetter + @nativeGetter fun take(a: Number): String? = null - nativeGetter + @nativeGetter fun foo(a: Double): String? = null companion object { - nativeGetter + @nativeGetter fun get(a: String): Any? = null - nativeGetter + @nativeGetter fun take(a: Number): String? = null - nativeGetter + @nativeGetter fun foo(a: Double): String? = null } } class B { - nativeGetter + @nativeGetter val foo = 0 - nativeGetter + @nativeGetter object Obj1 {} companion object { - nativeGetter + @nativeGetter val foo = 0 - nativeGetter + @nativeGetter object Obj2 {} } } class C { - nativeGetter + @nativeGetter fun Int.get(a: String): Int? = 1 - nativeGetter + @nativeGetter fun Int.get2(a: Number): String? = "OK" - nativeGetter + @nativeGetter fun Int.get3(a: Int): String? = "OK" - nativeGetter + @nativeGetter fun get(): Any? = null - nativeGetter + @nativeGetter fun get(a: A): Any? = null - nativeGetter + @nativeGetter fun foo(a: Int) {} - nativeGetter + @nativeGetter fun bar(a: String): Int = 0 - nativeGetter + @nativeGetter fun baz(a: String = "foo"): Int? = 0 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onToplevelExtensionFun.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onToplevelExtensionFun.kt index dfafd31f14b..df5a3c46e81 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onToplevelExtensionFun.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onToplevelExtensionFun.kt @@ -1,22 +1,22 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -nativeGetter +@nativeGetter fun Int.get(a: String): Int? = 1 -nativeGetter +@nativeGetter fun Int.get2(a: Number): String? = "OK" -nativeGetter +@nativeGetter fun Int.get3(a: Int): String? = "OK" -nativeGetter +@nativeGetter fun Int.baz(a: Int = 0): String? = "OK" -nativeGetter +@nativeGetter fun Int.get(a: Any): Int? = 1 -nativeGetter +@nativeGetter fun Int.get2(): String? = "OK" -nativeGetter +@nativeGetter fun Int.get3(a: Any, b: Int, c: Any?): String? = "OK" diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onToplevelOtherDeclarations.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onToplevelOtherDeclarations.kt index 8667a6bb92f..b3bf26f18d4 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onToplevelOtherDeclarations.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onToplevelOtherDeclarations.kt @@ -1,10 +1,10 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -nativeGetter +@nativeGetter fun toplevelFun(): Any = 0 -nativeGetter +@nativeGetter val toplevelVal = 0 -nativeGetter +@nativeGetter class Foo {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalNativeClassMembers.kt index c38123a503b..1bc9a08b376 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalNativeClassMembers.kt @@ -3,23 +3,23 @@ fun foo() { @native class A { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 - nativeInvoke + @nativeInvoke fun Int.ext() = 1 - nativeInvoke + @nativeInvoke fun Int.invoke(a: String, b: Int) = "OK" val anonymous = object { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalNonNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalNonNativeClassMembers.kt index f6cea21bccb..7f678552771 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalNonNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalNonNativeClassMembers.kt @@ -2,23 +2,23 @@ fun foo() { class A { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 - nativeInvoke + @nativeInvoke fun Int.ext() = 1 - nativeInvoke + @nativeInvoke fun Int.invoke(a: String, b: Int) = "OK" val anonymous = object { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNativeClassMembers.kt index 16f65270347..8db89fffce3 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNativeClassMembers.kt @@ -1,42 +1,42 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -native +@native class A { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 - nativeInvoke + @nativeInvoke fun Int.ext() = 1 - nativeInvoke + @nativeInvoke fun Int.invoke(a: String, b: Int) = "OK" - nativeInvoke + @nativeInvoke val foo = 0 - nativeInvoke + @nativeInvoke object Obj1 {} companion object { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 - nativeInvoke + @nativeInvoke fun Int.ext() = 1 - nativeInvoke + @nativeInvoke fun Int.invoke(a: String, b: Int) = "OK" - nativeInvoke + @nativeInvoke val foo = 0 - nativeInvoke + @nativeInvoke object Obj2 {} } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNestedDeclarationsInsideNativeClass.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNestedDeclarationsInsideNativeClass.kt index 35384f621b3..530723feed8 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNestedDeclarationsInsideNativeClass.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNestedDeclarationsInsideNativeClass.kt @@ -1,49 +1,49 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -native +@native class A { class B { class C { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 - nativeInvoke + @nativeInvoke fun Int.ext() = 1 - nativeInvoke + @nativeInvoke fun Int.invoke(a: String, b: Int) = "OK" } object obj { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 - nativeInvoke + @nativeInvoke fun Int.ext() = 1 - nativeInvoke + @nativeInvoke fun Int.invoke(a: String, b: Int) = "OK" } companion object { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 } val anonymous = object { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNestedDeclarationsInsideNonNativeClass.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNestedDeclarationsInsideNonNativeClass.kt index 8edfa72622b..96ed3325199 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNestedDeclarationsInsideNonNativeClass.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNestedDeclarationsInsideNonNativeClass.kt @@ -3,40 +3,40 @@ class A { class B { class C { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 - nativeInvoke + @nativeInvoke fun Int.ext() = 1 - nativeInvoke + @nativeInvoke fun Int.invoke(a: String, b: Int) = "OK" } object obj { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 } companion object { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 } val anonymous = object { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.kt index c273f6b8cf3..9b6895eb371 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.kt @@ -1,35 +1,35 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER class A { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 - nativeInvoke + @nativeInvoke fun Int.ext() = 1 - nativeInvoke + @nativeInvoke fun Int.invoke(a: String, b: Int) = "OK" - nativeInvoke + @nativeInvoke val foo = 0 - nativeInvoke + @nativeInvoke object Obj {} companion object { - nativeInvoke + @nativeInvoke fun foo() {} - nativeInvoke + @nativeInvoke fun invoke(a: String): Int = 0 - nativeInvoke + @nativeInvoke fun Int.ext() = 1 - nativeInvoke + @nativeInvoke fun Int.invoke(a: String, b: Int) = "OK" } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onToplevelExtensionFun.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onToplevelExtensionFun.kt index 9783e3c0c56..fd36efe2da6 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onToplevelExtensionFun.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onToplevelExtensionFun.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -nativeInvoke +@nativeInvoke fun Int.ext() = 1 -nativeInvoke +@nativeInvoke fun Int.invoke(a: String, b: Int) = "OK" diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onToplevelOtherDeclarations.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onToplevelOtherDeclarations.kt index 0eb7b9872fb..15380e00299 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onToplevelOtherDeclarations.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onToplevelOtherDeclarations.kt @@ -1,10 +1,10 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -nativeInvoke +@nativeInvoke fun toplevelFun() {} -nativeInvoke +@nativeInvoke val toplevelVal = 0 -nativeInvoke +@nativeInvoke class Foo {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNativeClassMembers.kt index 87b4c5541f8..57fa1e4ddfc 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNativeClassMembers.kt @@ -3,52 +3,52 @@ fun foo() { @native class A { - nativeSetter + @nativeSetter fun set(a: String, v: Any?): Any? = null - nativeSetter + @nativeSetter fun put(a: Number, v: String) {} - nativeSetter + @nativeSetter fun foo(a: Int, v: String) {} - nativeSetter + @nativeSetter fun set4(a: Double, v: String): Any = 1 - nativeSetter + @nativeSetter fun set5(a: Double, v: String): CharSequence = "OK" } @native class B { - nativeSetter + @nativeSetter val foo = 0 } @native class C { - nativeSetter + @nativeSetter fun Int.set(a: String, v: Int) {} - nativeSetter + @nativeSetter fun Int.set2(a: Number, v: String?) = "OK" - nativeSetter + @nativeSetter fun Int.set3(a: Double, v: String?) = "OK" - nativeSetter + @nativeSetter fun set6(a: Double, v: String): Number = 1 - nativeSetter + @nativeSetter fun set(): Any? = null - nativeSetter + @nativeSetter fun set(a: A): Any? = null - nativeSetter + @nativeSetter fun set(a: String, v: Any, v2: Any) {} - nativeSetter + @nativeSetter fun set(a: A, v: Any?) {} @nativeSetter diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNonNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNonNativeClassMembers.kt index f7d93275e55..f68c1c73241 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNonNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNonNativeClassMembers.kt @@ -2,41 +2,41 @@ fun foo() { class A { - nativeSetter + @nativeSetter fun set(a: String, v: Any?): Any? = null - nativeSetter + @nativeSetter fun put(a: Number, v: String) {} - nativeSetter + @nativeSetter fun foo(a: Int, v: String) {} } class B { - nativeSetter + @nativeSetter var foo = 0 } class C { - nativeSetter + @nativeSetter fun Int.set(a: String, v: Int) {} - nativeSetter + @nativeSetter fun Int.set2(a: Number, v: String?) = "OK" - nativeSetter + @nativeSetter fun Int.set3(a: Double, v: String?) = "OK" - nativeSetter + @nativeSetter fun set(): Any? = null - nativeSetter + @nativeSetter fun set(a: A): Any? = null - nativeSetter + @nativeSetter fun set(a: String, v: Any, v2: Any) {} - nativeSetter + @nativeSetter fun set(a: A, v: Any?) {} @nativeSetter diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNativeClassMembers.kt index b52d8ff3f14..338d4c9986c 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNativeClassMembers.kt @@ -1,81 +1,81 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -native +@native class A { - nativeSetter + @nativeSetter fun set(a: String, v: Any?): Any? = null - nativeSetter + @nativeSetter fun put(a: Number, v: String) {} - nativeSetter + @nativeSetter fun foo(a: Int, v: String) {} - nativeSetter + @nativeSetter fun set4(a: Double, v: String): Any = 1 - nativeSetter + @nativeSetter fun set5(a: Double, v: String): CharSequence = "OK" companion object { - nativeSetter + @nativeSetter fun set(a: String, v: Any?): Any? = null - nativeSetter + @nativeSetter fun put(a: Number, v: String) {} - nativeSetter + @nativeSetter fun foo(a: Int, v: String) {} - nativeSetter + @nativeSetter fun set4(a: Double, v: String): Any = 1 - nativeSetter + @nativeSetter fun set5(a: Double, v: String): CharSequence = "OK" } } -native +@native class B { - nativeSetter + @nativeSetter val foo = 0 - nativeSetter + @nativeSetter object Obj1 {} companion object { - nativeSetter + @nativeSetter val foo = 0 - nativeSetter + @nativeSetter object Obj2 {} } } -native +@native class C { - nativeSetter + @nativeSetter fun Int.set(a: String, v: Int) {} - nativeSetter + @nativeSetter fun Int.set2(a: Number, v: String?) = "OK" - nativeSetter + @nativeSetter fun Int.set3(a: Double, v: String?) = "OK" - nativeSetter + @nativeSetter fun set6(a: Double, v: String): Number = 1 - nativeSetter + @nativeSetter fun set(): Any? = null - nativeSetter + @nativeSetter fun set(a: A): Any? = null - nativeSetter + @nativeSetter fun set(a: String, v: Any, v2: Any) {} - nativeSetter + @nativeSetter fun set(a: A, v: Any?) {} @nativeSetter diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNativeClass.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNativeClass.kt index 1c39e49055d..750b67418a7 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNativeClass.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNativeClass.kt @@ -1,81 +1,81 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -native +@native class A { class B { class A { - nativeSetter + @nativeSetter fun set(a: String, v: Any?): Any? = null - nativeSetter + @nativeSetter fun put(a: Number, v: String) {} - nativeSetter + @nativeSetter fun foo(a: Int, v: String) {} - nativeSetter + @nativeSetter fun set4(a: Double, v: String): Any = 1 - nativeSetter + @nativeSetter fun set5(a: Double, v: String): CharSequence = "OK" companion object { - nativeSetter + @nativeSetter fun set(a: String, v: Any?): Any? = null - nativeSetter + @nativeSetter fun put(a: Number, v: String) {} - nativeSetter + @nativeSetter fun foo(a: Int, v: String) {} - nativeSetter + @nativeSetter fun set4(a: Double, v: String): Any = 1 - nativeSetter + @nativeSetter fun set5(a: Double, v: String): CharSequence = "OK" } } class B { - nativeSetter + @nativeSetter val foo = 0 - nativeSetter + @nativeSetter object Obj1 {} companion object { - nativeSetter + @nativeSetter val foo = 0 - nativeSetter + @nativeSetter object Obj2 {} } } class C { - nativeSetter + @nativeSetter fun Int.set(a: String, v: Int) {} - nativeSetter + @nativeSetter fun Int.set2(a: Number, v: String?) = "OK" - nativeSetter + @nativeSetter fun Int.set3(a: Double, v: String?) = "OK" - nativeSetter + @nativeSetter fun set6(a: Double, v: String): Number = 1 - nativeSetter + @nativeSetter fun set(): Any? = null - nativeSetter + @nativeSetter fun set(a: A): Any? = null - nativeSetter + @nativeSetter fun set(a: String, v: Any, v2: Any) {} - nativeSetter + @nativeSetter fun set(a: A, v: Any?) {} @nativeSetter @@ -83,25 +83,25 @@ class A { } object obj { - nativeSetter + @nativeSetter fun Int.set(a: String, v: Int) {} - nativeSetter + @nativeSetter fun Int.set2(a: Number, v: String?) = "OK" - nativeSetter + @nativeSetter fun Int.set3(a: Double, v: String?) = "OK" - nativeSetter + @nativeSetter fun set(): Any? = null - nativeSetter + @nativeSetter fun set(a: A): Any? = null - nativeSetter + @nativeSetter fun set(a: String, v: Any, v2: Any) {} - nativeSetter + @nativeSetter fun set(a: A, v: Any?) {} @nativeSetter @@ -109,25 +109,25 @@ class A { } val anonymous = object { - nativeSetter + @nativeSetter fun Int.set(a: String, v: Int) {} - nativeSetter + @nativeSetter fun Int.set2(a: Number, v: String?) = "OK" - nativeSetter + @nativeSetter fun Int.set3(a: Double, v: String?) = "OK" - nativeSetter + @nativeSetter fun set(): Any? = null - nativeSetter + @nativeSetter fun set(a: A): Any? = null - nativeSetter + @nativeSetter fun set(a: String, v: Any, v2: Any) {} - nativeSetter + @nativeSetter fun set(a: A, v: Any?) {} @nativeSetter diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNonNativeClass.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNonNativeClass.kt index 425ca02f3c3..e835eb1bb11 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNonNativeClass.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNonNativeClass.kt @@ -3,72 +3,72 @@ class A { class B { class A { - nativeSetter + @nativeSetter fun set(a: String, v: Any?): Any? = null - nativeSetter + @nativeSetter fun put(a: Number, v: String) {} - nativeSetter + @nativeSetter fun foo(a: Int, v: String) {} - nativeSetter + @nativeSetter fun set4(a: Double, v: String): Any = 1 - nativeSetter + @nativeSetter fun set5(a: Double, v: String): CharSequence = "OK" companion object { - nativeSetter + @nativeSetter fun set(a: String, v: Any?): Any? = null - nativeSetter + @nativeSetter fun put(a: Number, v: String) {} - nativeSetter + @nativeSetter fun foo(a: Int, v: String) {} } } class B { - nativeSetter + @nativeSetter val foo = 0 - nativeSetter + @nativeSetter object Obj1 {} companion object { - nativeSetter + @nativeSetter val foo = 0 - nativeSetter + @nativeSetter object Obj2 {} } } class C { - nativeSetter + @nativeSetter fun Int.set(a: String, v: Int) {} - nativeSetter + @nativeSetter fun Int.set2(a: Number, v: String?) = "OK" - nativeSetter + @nativeSetter fun Int.set3(a: Double, v: String?) = "OK" - nativeSetter + @nativeSetter fun Int.set6(a: Double, v: String): Number = 1 - nativeSetter + @nativeSetter fun set(): Any? = null - nativeSetter + @nativeSetter fun set(a: A): Any? = null - nativeSetter + @nativeSetter fun set(a: String, v: Any, v2: Any) {} - nativeSetter + @nativeSetter fun set(a: A, v: Any?) {} @nativeSetter @@ -76,25 +76,25 @@ class A { } object obj { - nativeSetter + @nativeSetter fun Int.set(a: String, v: Int) {} - nativeSetter + @nativeSetter fun Int.set2(a: Number, v: String?) = "OK" - nativeSetter + @nativeSetter fun Int.set3(a: Double, v: String?) = "OK" - nativeSetter + @nativeSetter fun set(): Any? = null - nativeSetter + @nativeSetter fun set(a: A): Any? = null - nativeSetter + @nativeSetter fun set(a: String, v: Any, v2: Any) {} - nativeSetter + @nativeSetter fun set(a: A, v: Any?) {} @nativeSetter @@ -102,25 +102,25 @@ class A { } val anonymous = object { - nativeSetter + @nativeSetter fun Int.set(a: String, v: Int) {} - nativeSetter + @nativeSetter fun Int.set2(a: Number, v: String?) = "OK" - nativeSetter + @nativeSetter fun Int.set3(a: Double, v: String?) = "OK" - nativeSetter + @nativeSetter fun set(): Any? = null - nativeSetter + @nativeSetter fun set(a: A): Any? = null - nativeSetter + @nativeSetter fun set(a: String, v: Any, v2: Any) {} - nativeSetter + @nativeSetter fun set(a: A, v: Any?) {} @nativeSetter diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNonNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNonNativeClassMembers.kt index cfff8f1d899..95b0d96c5d3 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNonNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNonNativeClassMembers.kt @@ -1,63 +1,63 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER class A { - nativeSetter + @nativeSetter fun set(a: String, v: Any?): Any? = null - nativeSetter + @nativeSetter fun put(a: Number, v: String) {} - nativeSetter + @nativeSetter fun foo(a: Int, v: String) {} companion object { - nativeSetter + @nativeSetter fun set(a: String, v: Any?): Any? = null - nativeSetter + @nativeSetter fun put(a: Number, v: String) {} - nativeSetter + @nativeSetter fun foo(a: Int, v: String) {} } } class B { - nativeSetter + @nativeSetter val foo = 0 - nativeSetter + @nativeSetter object Obj1 {} companion object { - nativeSetter + @nativeSetter val foo = 0 - nativeSetter + @nativeSetter object Obj2 {} } } class C { - nativeSetter + @nativeSetter fun Int.set(a: String, v: Int) {} - nativeSetter + @nativeSetter fun Int.set2(a: Number, v: String?) = "OK" - nativeSetter + @nativeSetter fun Int.set3(a: Double, v: String?) = "OK" - nativeSetter + @nativeSetter fun set(): Any? = null - nativeSetter + @nativeSetter fun set(a: A): Any? = null - nativeSetter + @nativeSetter fun set(a: String, v: Any, v2: Any) {} - nativeSetter + @nativeSetter fun set(a: A, v: Any?) {} @nativeSetter diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onToplevelExtensionFun.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onToplevelExtensionFun.kt index 20e4e44c14c..7035c24f74d 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onToplevelExtensionFun.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onToplevelExtensionFun.kt @@ -1,31 +1,31 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -nativeSetter +@nativeSetter fun Int.set(a: String, v: Int) {} -nativeSetter +@nativeSetter fun Int.set2(a: Number, v: String?): Any? = null -nativeSetter +@nativeSetter fun Int.set3(a: Double, v: String) = "OK" -nativeSetter +@nativeSetter fun Int.set4(a: Double, v: String): Any = 1 -nativeSetter +@nativeSetter fun Int.set5(a: Double, v: String): CharSequence = "OK" -nativeSetter +@nativeSetter fun Int.set6(a: Double, v: String): Number = 1 -nativeSetter +@nativeSetter fun Any.foo(a: String = "0.0", v: String = "str") = "OK" -nativeSetter +@nativeSetter fun Int.set(a: A): Int? = 1 -nativeSetter +@nativeSetter fun Int.set2(): String? = "OK" -nativeSetter +@nativeSetter fun Int.set3(a: Any, b: Int, c: Any?) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onToplevelOtherDeclarations.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onToplevelOtherDeclarations.kt index 2224207cd9d..dff45959133 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onToplevelOtherDeclarations.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onToplevelOtherDeclarations.kt @@ -1,10 +1,10 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -nativeSetter +@nativeSetter fun toplevelFun(): Any = 0 -nativeSetter +@nativeSetter val toplevelVal = 0 -nativeSetter +@nativeSetter class Foo {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/native.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/native.kt index 2d56b6fc0ae..5b9a9d9b664 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/native.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/native.kt @@ -1,22 +1,22 @@ -native +@native val baz: Int -native +@native val boo: Int = noImpl -native +@native val Int.baz: Int -native +@native fun foo() -native +@native fun bar() {} -native +@native fun String.foo(): Int -native +@native fun String.bar(): Int = noImpl -native +@native interface T { val baz: Int @@ -32,7 +32,7 @@ interface T { } } -native +@native class C { val baz: Int val boo: Int = noImpl @@ -49,7 +49,7 @@ class C { } } -native +@native object O { val baz: Int val boo: Int = noImpl diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeGetter.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeGetter.kt index a24f4ef62a9..1aa68c19387 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeGetter.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeGetter.kt @@ -1,13 +1,13 @@ -nativeGetter +@nativeGetter fun String.foo(n: Int): Int? -nativeGetter +@nativeGetter fun String.bar(n: Int): Int? = noImpl -native +@native interface T { - nativeGetter + @nativeGetter fun foo(d: Double): String? - nativeGetter + @nativeGetter fun bar(d: Double): String? = noImpl } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeInvoke.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeInvoke.kt index 55900e9bd9a..b9eef6f4fca 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeInvoke.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeInvoke.kt @@ -1,13 +1,13 @@ -nativeInvoke +@nativeInvoke fun String.foo(): Int -nativeInvoke +@nativeInvoke fun String.bar(): Int = noImpl -native +@native object O { - nativeInvoke + @nativeInvoke fun foo() - nativeInvoke + @nativeInvoke fun bar() {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeSetter.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeSetter.kt index acdb5174c2e..e2bdc64716f 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeSetter.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/nativeSetter.kt @@ -1,13 +1,13 @@ -nativeSetter +@nativeSetter fun String.foo(n: Int, v: Any) -nativeSetter +@nativeSetter fun String.bar(n: Int, v: Any) {} -native +@native class C { - nativeSetter + @nativeSetter fun foo(d: Double, v: Any): Any - nativeSetter + @nativeSetter fun bar(d: Double, v: Any): Any = noImpl } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/native.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/native.kt index afd5534978f..e1921c0399f 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/native.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/native.kt @@ -1,15 +1,15 @@ -native +@native fun foo(a: String): Int = noImpl -native +@native fun Int.foo(a: String): Int = noImpl -native +@native class Bar(b: Int, c: Char) { fun baz(d: Int) {} } -native +@native object Obj { fun test1(e: String) {} object Nested { diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeGetter.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeGetter.kt index 21446517c54..14061dce11c 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeGetter.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeGetter.kt @@ -1,19 +1,19 @@ -nativeGetter +@nativeGetter fun Int.foo(a: String): Int? = noImpl -native +@native class Bar(b: Int, c: Char) { - nativeGetter + @nativeGetter fun baz(d: Int): Any? = noImpl } -native +@native object Obj { - nativeGetter + @nativeGetter fun test1(e: String): String? = noImpl object Nested { - nativeGetter + @nativeGetter fun test2(g: Int): Any? = noImpl } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeInvoke.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeInvoke.kt index ae2a1a14c75..c6fd1882c9e 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeInvoke.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeInvoke.kt @@ -1,19 +1,19 @@ -nativeInvoke +@nativeInvoke fun Int.foo(a: String): Int = noImpl -native +@native class Bar(b: Int, c: Char) { - nativeInvoke + @nativeInvoke fun baz(d: Int) {} } -native +@native object Obj { - nativeInvoke + @nativeInvoke fun test1(e: String) {} object Nested { - nativeInvoke + @nativeInvoke fun test2(g: Int) {} } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeSetter.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeSetter.kt index 700a3d9e51b..8a59b0024e9 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeSetter.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/unusedParam/nativeSetter.kt @@ -1,19 +1,19 @@ -nativeSetter +@nativeSetter fun Int.foo(a: String, v: Int): Int = noImpl -native +@native class Bar(b: Int, c: Char) { - nativeSetter + @nativeSetter fun baz(d: Int, v: Int) {} } -native +@native object Obj { - nativeSetter + @nativeSetter fun test1(e: String, v: Any) {} object Nested { - nativeSetter + @nativeSetter fun test2(g: Int, v: Any) {} } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.kt index 8d190a5e007..013dac39c06 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.kt @@ -5,7 +5,8 @@ annotation class AnnClass(val a: KClass<*>) class MyClass { - AnnClass(MyClass::class) companion object { + @AnnClass(MyClass::class) + companion object { } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.kt index 2e23bd44b77..444b52132d8 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.kt @@ -30,8 +30,8 @@ var vardef: Int = 1 set @JvmName("C") -class C JvmName("primary") constructor() { - JvmName("ctr") constructor(x: Int): this() {} +class C @JvmName("primary") constructor() { + @JvmName("ctr") constructor(x: Int): this() {} @JvmName("a") fun foo() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationClassMethodCall.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationClassMethodCall.kt index 5b693198ebd..851fa6b7a92 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationClassMethodCall.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationClassMethodCall.kt @@ -5,7 +5,7 @@ public @interface A { } // FILE: b.kt -A(value = "a", arg = 1) class MyClass +@A(value = "a", arg = 1) class MyClass fun foo(ann: A) { ann.value() diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/array.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/array.kt index 7dff030aedf..84fc142e41e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/array.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/array.kt @@ -2,11 +2,11 @@ @Repeatable annotation class Ann(val i: IntArray) -Ann(intArrayOf(i)) -Ann(intArrayOf(i2)) -Ann(intArrayOf(i3)) -Ann(intArrayOf(i, i2, i3)) -Ann(intArrayOf(intArrayOf(i, i2, i3))) +@Ann(intArrayOf(i)) +@Ann(intArrayOf(i2)) +@Ann(intArrayOf(i3)) +@Ann(intArrayOf(i, i2, i3)) +@Ann(intArrayOf(intArrayOf(i, i2, i3))) class Test var i = 1 @@ -18,7 +18,7 @@ fun foo(): Int = 1 @Retention(AnnotationRetention.SOURCE) @Repeatable annotation class AnnAnn(val i: Array) -AnnAnn(arrayOf(Ann(intArrayOf(1)))) -AnnAnn(arrayOf(iAnn)) +@AnnAnn(arrayOf(Ann(intArrayOf(1)))) +@AnnAnn(arrayOf(iAnn)) class TestAnn val iAnn = Ann(intArrayOf(1)) diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/simple.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/simple.kt index 01d62ca00eb..2f45c70358e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/simple.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/simple.kt @@ -4,14 +4,14 @@ annotation class Ann(val i: Int) annotation class AnnIA(val ia: IntArray) annotation class AnnSA(val sa: Array) -Ann(MyClass().i) -Ann(i) -Ann(i2) -AnnIA(ia) -AnnSA(sa) +@Ann(MyClass().i) +@Ann(i) +@Ann(i2) +@AnnIA(ia) +@AnnSA(sa) class Test { val i = 1 - Ann(i) val i2 = 1 + @Ann(i) val i2 = 1 } var i = 1 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/vararg.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/vararg.kt index 131b87fe0f8..7113b4810e2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/vararg.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/vararg.kt @@ -2,14 +2,14 @@ @Repeatable annotation class Ann(vararg val i: Int) -Ann(i) -Ann(i2) -Ann(i3) -Ann(i, i2, i3) -Ann(*intArrayOf(i)) -Ann(*intArrayOf(i2)) -Ann(*intArrayOf(i3)) -Ann(*intArrayOf(i, i2, i3)) +@Ann(i) +@Ann(i2) +@Ann(i3) +@Ann(i, i2, i3) +@Ann(*intArrayOf(i)) +@Ann(*intArrayOf(i2)) +@Ann(*intArrayOf(i3)) +@Ann(*intArrayOf(i, i2, i3)) class Test var i = 1 @@ -21,7 +21,7 @@ fun foo(): Int = 1 @Retention(AnnotationRetention.SOURCE) @Repeatable annotation class AnnAnn(vararg val i: Ann) -AnnAnn(*arrayOf(Ann(1))) -AnnAnn(*arrayOf(iAnn)) +@AnnAnn(*arrayOf(Ann(1))) +@AnnAnn(*arrayOf(iAnn)) class TestAnn val iAnn = Ann(1) diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/annotationAsArgument.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/annotationAsArgument.kt index 7f5a0741787..0eb01196673 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/annotationAsArgument.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/annotationAsArgument.kt @@ -12,8 +12,8 @@ public @interface B { } // FILE: c.kt -A(arg = String::class, b = B(y = 1)) class MyClass1 +@A(arg = String::class, b = B(y = 1)) class MyClass1 -A(b = B(y = 3)) class MyClass2 +@A(b = B(y = 3)) class MyClass2 -A(arg = String::class, b = B(arg = Boolean::class)) class MyClass3 +@A(arg = String::class, b = B(arg = Boolean::class)) class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.kt index 8ebceba25de..f315401b9ec 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.kt @@ -4,4 +4,4 @@ public @interface A { } // FILE: b.kt -A(arg = String::class) class MyClass3 +@A(arg = String::class) class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.kt index e63b667127e..8c63da99041 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.kt @@ -5,5 +5,5 @@ public @interface A { } // FILE: b.kt -A(arg = String::class) class MyClass1 -A(arg = String::class, x = 2) class MyClass2 +@A(arg = String::class) class MyClass1 +@A(arg = String::class, x = 2) class MyClass2 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.kt index 13d59e70e01..df2e3af5c26 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.kt @@ -4,4 +4,4 @@ public @interface A { } // FILE: b.kt -A(arg = arrayOf(String::class, Int::class)) class MyClass +@A(arg = arrayOf(String::class, Int::class)) class MyClass diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.kt index 64aed105d66..4871b8a02be 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.kt @@ -4,5 +4,5 @@ public @interface A { } // FILE: b.kt -A(arg = String::class) class MyClass1 -A class MyClass2 +@A(arg = String::class) class MyClass1 +@A class MyClass2 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.kt index 958ed4fefdf..3afac3724b5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.kt @@ -5,5 +5,5 @@ public @interface A { } // FILE: b.kt -A(arg = String::class, x = 4) class MyClass2 -A(x = 5) class MyClass3 +@A(arg = String::class, x = 4) class MyClass2 +@A(x = 5) class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.kt index c375d41a9dd..aa9efe04fa6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.kt @@ -5,4 +5,4 @@ public @interface A { } // FILE: b.kt -A(arg1 = String::class, arg2 = Int::class) class MyClass +@A(arg1 = String::class, arg2 = Int::class) class MyClass diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.kt index 85e0e4a59f2..ffd1adc3510 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.kt @@ -4,5 +4,5 @@ public @interface A { } // FILE: b.kt -A(String::class) class MyClass1 -A(value = String::class) class MyClass2 +@A(String::class) class MyClass1 +@A(value = String::class) class MyClass2 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.kt index e7a00b6e965..35a0ee2d2ae 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.kt @@ -5,8 +5,8 @@ public @interface A { } // FILE: b.kt -A(String::class) class MyClass1 -A(value = String::class) class MyClass2 +@A(String::class) class MyClass1 +@A(value = String::class) class MyClass2 -A(String::class, x = 2) class MyClass3 -A(value = String::class, x = 4) class MyClass4 +@A(String::class, x = 2) class MyClass3 +@A(value = String::class, x = 4) class MyClass4 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.kt index e2c02010f11..82f4b1623c2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.kt @@ -4,6 +4,6 @@ public @interface A { } // FILE: b.kt -A(String::class, Int::class) class MyClass1 -A(*arrayOf(String::class, Int::class)) class MyClass2 -A(value = *arrayOf(String::class, Int::class)) class MyClass3 +@A(String::class, Int::class) class MyClass1 +@A(*arrayOf(String::class, Int::class)) class MyClass2 +@A(value = *arrayOf(String::class, Int::class)) class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.kt index ede8c8a4dd2..50c72be5673 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.kt @@ -4,6 +4,6 @@ public @interface A { } // FILE: b.kt -A(String::class) class MyClass1 -A(value = String::class) class MyClass2 -A class MyClass3 +@A(String::class) class MyClass1 +@A(value = String::class) class MyClass2 +@A class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.kt index b011a4d01e4..465a8f35e3d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.kt @@ -5,6 +5,6 @@ public @interface A { } // FILE: b.kt -A(String::class, x = 2) class MyClass1 -A(value = String::class, x = 4) class MyClass2 -A(x = 5) class MyClass3 +@A(String::class, x = 2) class MyClass1 +@A(value = String::class, x = 4) class MyClass2 +@A(x = 5) class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt index 3c135ad0b86..0014e8ad887 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt @@ -6,22 +6,22 @@ class B2 : A() annotation class Ann1(val arg: Array>) -Ann1(arrayOf(A::class)) +@Ann1(arrayOf(A::class)) class MyClass1 -Ann1(arrayOf(Any::class)) +@Ann1(arrayOf(Any::class)) class MyClass1a -Ann1(arrayOf(B1::class)) +@Ann1(arrayOf(B1::class)) class MyClass2 annotation class Ann2(val arg: Array>) -Ann2(arrayOf(A::class)) +@Ann2(arrayOf(A::class)) class MyClass3 -Ann2(arrayOf(B1::class)) +@Ann2(arrayOf(B1::class)) class MyClass4 -Ann2(arrayOf(B2::class)) +@Ann2(arrayOf(B2::class)) class MyClass5 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt index 63778eb04ad..dbb0f113361 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt @@ -6,22 +6,22 @@ class B2 : A() annotation class Ann1(val arg: Array>) -Ann1(arrayOf(A::class)) +@Ann1(arrayOf(A::class)) class MyClass1 -Ann1(arrayOf(Any::class)) +@Ann1(arrayOf(Any::class)) class MyClass1a -Ann1(arrayOf(B1::class)) +@Ann1(arrayOf(B1::class)) class MyClass2 annotation class Ann2(val arg: Array>) -Ann2(arrayOf(A::class)) +@Ann2(arrayOf(A::class)) class MyClass3 -Ann2(arrayOf(B1::class)) +@Ann2(arrayOf(B1::class)) class MyClass4 -Ann2(arrayOf(B2::class)) +@Ann2(arrayOf(B2::class)) class MyClass5 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotation.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotation.kt index 2290d310525..0b0c02a3976 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotation.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotation.kt @@ -7,14 +7,14 @@ annotation class Ann3(val arg: Array>) class A1 class A2 -Ann1(A1::class) -Ann2(A1::class, A2::class) -Ann3(arrayOf(A1::class, A2::class)) +@Ann1(A1::class) +@Ann2(A1::class, A2::class) +@Ann3(arrayOf(A1::class, A2::class)) class MyClass1 -Ann1(A3::class) +@Ann1(A3::class) class MyClass2 val x = A1::class -Ann1(x) +@Ann1(x) class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotationsInVariance.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotationsInVariance.kt index 72bd2f0bb99..665f350b0ec 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotationsInVariance.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotationsInVariance.kt @@ -6,22 +6,22 @@ class B2 : A() annotation class Ann1(val arg: KClass) -Ann1(A::class) +@Ann1(A::class) class MyClass1 -Ann1(Any::class) +@Ann1(Any::class) class MyClass1a -Ann1(B1::class) +@Ann1(B1::class) class MyClass2 annotation class Ann2(val arg: KClass) -Ann2(A::class) +@Ann2(A::class) class MyClass3 -Ann2(B1::class) +@Ann2(B1::class) class MyClass4 -Ann2(B2::class) +@Ann2(B2::class) class MyClass5 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotationsOutVariance.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotationsOutVariance.kt index 717c67ca2aa..96a8c5304b9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotationsOutVariance.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInAnnotationsOutVariance.kt @@ -6,22 +6,22 @@ class B2 : A() annotation class Ann1(val arg: KClass) -Ann1(A::class) +@Ann1(A::class) class MyClass1 -Ann1(Any::class) +@Ann1(Any::class) class MyClass1a -Ann1(B1::class) +@Ann1(B1::class) class MyClass2 annotation class Ann2(val arg: KClass) -Ann2(A::class) +@Ann2(A::class) class MyClass3 -Ann2(B1::class) +@Ann2(B1::class) class MyClass4 -Ann2(B2::class) +@Ann2(B2::class) class MyClass5 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInvariantTP.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInvariantTP.kt index 6aa0b87f366..3b587472a36 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInvariantTP.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassInvariantTP.kt @@ -5,19 +5,19 @@ class B : A() annotation class Ann1(val arg: KClass) -Ann1(A::class) +@Ann1(A::class) class MyClass1 -Ann1(Any::class) +@Ann1(Any::class) class MyClass1a -Ann1(B::class) +@Ann1(B::class) class MyClass2 annotation class Ann2(val arg: KClass) -Ann2(A::class) +@Ann2(A::class) class MyClass3 -Ann2(B::class) +@Ann2(B::class) class MyClass4 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructors.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructors.kt index 5722ffa4d51..1894eba6e94 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructors.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/constructors.kt @@ -1,9 +1,9 @@ import kotlin.jvm.JvmStatic class A { - JvmStatic constructor() {} + @JvmStatic constructor() {} inner class B { - JvmStatic constructor() {} + @JvmStatic constructor() {} } } -class C JvmStatic constructor() \ No newline at end of file +class C @JvmStatic constructor() \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/functions.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/functions.kt index 4fc352bf328..79ecaa549cd 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/functions.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/functions.kt @@ -3,52 +3,52 @@ import kotlin.jvm.JvmStatic class A { companion object { - JvmStatic fun a1() { + @JvmStatic fun a1() { } } object A { - JvmStatic fun a2() { + @JvmStatic fun a2() { } } fun test() { val s = object { - JvmStatic fun a3() { + @JvmStatic fun a3() { } } } - JvmStatic fun a4() { + @JvmStatic fun a4() { } } interface B { companion object { - JvmStatic fun a1() { + @JvmStatic fun a1() { } } object A { - JvmStatic fun a2() { + @JvmStatic fun a2() { } } fun test() { val s = object { - JvmStatic fun a3() { + @JvmStatic fun a3() { } } } - JvmStatic fun a4() { + @JvmStatic fun a4() { } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/property.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/property.kt index fe0144e38db..99d43381785 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/property.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/property.kt @@ -31,7 +31,7 @@ class A { @JvmStatic override val base1: Int = 0 - JvmStatic open fun f() {} + @JvmStatic open fun f() {} override val base2: Int = 0 @JvmStatic get diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.kt index c55836e20a1..be23e84ff89 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.kt @@ -1,5 +1,5 @@ annotation class Ann(val x: Int, val value: String, val y: Double) -Ann(value = "a", x = 1, y = 1.0) fun foo1() {} -Ann(2, "b", 2.0) fun foo2() {} -Ann(3, "c", y = 2.0) fun foo3() {} +@Ann(value = "a", x = 1, y = 1.0) fun foo1() {} +@Ann(2, "b", 2.0) fun foo2() {} +@Ann(3, "c", y = 2.0) fun foo3() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/tooManyArgs.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/tooManyArgs.kt index d5c1acdfdbb..1f58e628d42 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/tooManyArgs.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/tooManyArgs.kt @@ -6,6 +6,6 @@ public @interface A { } // FILE: b.kt -A(false, +@A(false, 1.0, false, 1, 2) fun foo1() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/typeMismatch.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/typeMismatch.kt index 255c20e81c6..fe5e4e0fb26 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/typeMismatch.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/typeMismatch.kt @@ -6,8 +6,8 @@ public @interface A { } // FILE: b.kt -A(false, +@A(false, 1.0, false) fun foo1() {} -A(2.0, x = true, b = 2.0) fun foo2() {} +@A(2.0, x = true, b = 2.0) fun foo2() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/withValue.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/withValue.kt index 838498af4f7..3ab7061f744 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/withValue.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/withValue.kt @@ -7,11 +7,11 @@ public @interface A { } // FILE: b.kt -A("v1", 1, +@A("v1", 1, 1.0, false) fun foo1() {} -A("v2", 2, x = true, b = 2.0) fun foo2() {} +@A("v2", 2, x = true, b = 2.0) fun foo2() {} -A("v2", x = true, b = 3.0, a = 4) fun foo3() {} -A(value = "v2", x = true, b = 3.0, a = 4) fun foo4() {} +@A("v2", x = true, b = 3.0, a = 4) fun foo3() {} +@A(value = "v2", x = true, b = 3.0, a = 4) fun foo4() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/withoutValue.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/withoutValue.kt index 09d9d985f46..3660b7f2647 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/withoutValue.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/withoutValue.kt @@ -6,12 +6,12 @@ public @interface A { } // FILE: b.kt -A(1, +@A(1, 1.0, false) fun foo1() {} -A(2, x = true, b = 2.0) fun foo2() {} +@A(2, x = true, b = 2.0) fun foo2() {} -A(x = true, b = 3.0, a = 4) fun foo3() {} +@A(x = true, b = 3.0, a = 4) fun foo3() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/qualifiedCallValue.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/qualifiedCallValue.kt index 20d34081c5f..30af338c316 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/qualifiedCallValue.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/qualifiedCallValue.kt @@ -1,19 +1,19 @@ // !DIAGNOSTICS: -JAVA_LANG_CLASS_PARAMETER_IN_ANNOTATION package a.b.c -kotlin.Deprecated("aaa") -ann1(kotlin.Deprecated("aaa")) +@kotlin.Deprecated("aaa") +@ann1(kotlin.Deprecated("aaa")) -a.b.c.ann1() -ann2(a.b.c.ann1()) +@a.b.c.ann1() +@ann2(a.b.c.ann1()) -A.IAnn() -ann3(A.IAnn()) +@A.IAnn() +@ann3(A.IAnn()) -a.b.c.A.IAnn() -ann3(a.b.c.A.IAnn()) +@a.b.c.A.IAnn() +@ann3(a.b.c.A.IAnn()) -annArray(kotlin.arrayOf("a")) +@annArray(kotlin.arrayOf("a")) fun test() = 1 annotation class ann1(val p: Deprecated = kotlin.Deprecated("aaa")) diff --git a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformStaticInClassObject.kt b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformStaticInClassObject.kt index 6266d73a424..06a40f8e5c6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformStaticInClassObject.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformStaticInClassObject.kt @@ -6,6 +6,6 @@ open class Base { class Derived : Base() { companion object { - JvmStatic fun foo() {} + @JvmStatic fun foo() {} } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformStaticInObject.kt b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformStaticInObject.kt index 3cf367e66cd..d6b5cfe52c5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformStaticInObject.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformStaticInObject.kt @@ -6,5 +6,5 @@ open class Base { } object Derived : Base() { - JvmStatic fun foo(i: Int = 0) {} + @JvmStatic fun foo(i: Int = 0) {} } diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java index 5f49f886b43..d0caa036cc8 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java @@ -996,6 +996,27 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { } } + @TestMetadata("compiler/testData/diagnostics/tests/annotations/migration") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Migration extends AbstractJetDiagnosticsTest { + public void testAllFilesPresentInMigration() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/migration"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("escapedModifiers.kt") + public void testEscapedModifiers() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/annotations/migration/escapedModifiers.kt"); + doTest(fileName); + } + + @TestMetadata("unescapedAnnotation.kt") + public void testUnescapedAnnotation() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/annotations/migration/unescapedAnnotation.kt"); + doTest(fileName); + } + } + @TestMetadata("compiler/testData/diagnostics/tests/annotations/options") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/idea/testData/checker/PlatformStaticUsagesRuntime.kt b/idea/testData/checker/PlatformStaticUsagesRuntime.kt index c75bfd65dbc..9cd41782085 100644 --- a/idea/testData/checker/PlatformStaticUsagesRuntime.kt +++ b/idea/testData/checker/PlatformStaticUsagesRuntime.kt @@ -4,27 +4,27 @@ import kotlin.jvm.JvmStatic class A { JvmStatic companion object { - JvmStatic fun a1() { + @JvmStatic fun a1() { } } - JvmStatic + @JvmStatic object A { - JvmStatic fun a2() { + @JvmStatic fun a2() { } } fun test() { val s = object { - JvmStatic fun a3() { + @JvmStatic fun a3() { } } } - JvmStatic fun a4() { + @JvmStatic fun a4() { } } @@ -32,26 +32,26 @@ class A { JvmStatic interface B { companion object { - JvmStatic fun a1() { + @JvmStatic fun a1() { } } object A { - JvmStatic fun a2() { + @JvmStatic fun a2() { } } fun test() { val s = object { - JvmStatic fun a3() { + @JvmStatic fun a3() { } } } - JvmStatic fun a4() { + @JvmStatic fun a4() { } } \ No newline at end of file diff --git a/idea/testData/highlighter/Annotations.kt b/idea/testData/highlighter/Annotations.kt index 2f1ee3c46a2..42faf285288 100644 --- a/idea/testData/highlighter/Annotations.kt +++ b/idea/testData/highlighter/Annotations.kt @@ -1,12 +1,11 @@ -target(AnnotationTarget.CLASSIFIER, AnnotationTarget.EXPRESSION) +@Target(AnnotationTarget.CLASSIFIER, AnnotationTarget.EXPRESSION) annotation class Ann -Ann class A1 -@Ann class A2 +@Ann class A fun bar(block: () -> Int) = block() -@private +private fun foo() { 1 + @Ann 2 diff --git a/idea/testData/highlighter/JavaTypes.kt b/idea/testData/highlighter/JavaTypes.kt index 13d2c1a3a95..be06d93951f 100644 --- a/idea/testData/highlighter/JavaTypes.kt +++ b/idea/testData/highlighter/JavaTypes.kt @@ -1,2 +1,2 @@ -SuppressWarnings class TheClass : Runnable, Thread() { +@SuppressWarnings class TheClass : Runnable, Thread() { } \ No newline at end of file diff --git a/idea/testData/highlighter/TypesAndAnnotations.kt b/idea/testData/highlighter/TypesAndAnnotations.kt index cff78f90f8d..a982ae3ef53 100644 --- a/idea/testData/highlighter/TypesAndAnnotations.kt +++ b/idea/testData/highlighter/TypesAndAnnotations.kt @@ -8,5 +8,5 @@ class TheClass : annotation class Deprecated @Deprecated -magnificent abstract class AbstractClass<T> { +@magnificent abstract class AbstractClass<T> { } diff --git a/idea/testData/highlighter/deprecated/Class.kt b/idea/testData/highlighter/deprecated/Class.kt index 54463f24cad..95f0a217fda 100644 --- a/idea/testData/highlighter/deprecated/Class.kt +++ b/idea/testData/highlighter/deprecated/Class.kt @@ -2,7 +2,7 @@ package test import java.util.ArrayList -Deprecated("Use A instead") open class MyClass {} +@Deprecated("Use A instead") open class MyClass {} fun test() { val a : MyClass? = null diff --git a/idea/testData/highlighter/deprecated/ClassObject.kt b/idea/testData/highlighter/deprecated/ClassObject.kt index 1131b713de9..86efefe728d 100644 --- a/idea/testData/highlighter/deprecated/ClassObject.kt +++ b/idea/testData/highlighter/deprecated/ClassObject.kt @@ -13,13 +13,13 @@ fun test() { } class MyClass(): MyTrait { - Deprecated("Use A instead") companion object { + @Deprecated("Use A instead") companion object { val test: String = "" } } interface MyTrait { - Deprecated("Use A instead") companion object { + @Deprecated("Use A instead") companion object { val test: String = "" } } diff --git a/idea/testData/highlighter/deprecated/ExtensionFunction.kt b/idea/testData/highlighter/deprecated/ExtensionFunction.kt index f82d790106e..d47c6eaedf7 100644 --- a/idea/testData/highlighter/deprecated/ExtensionFunction.kt +++ b/idea/testData/highlighter/deprecated/ExtensionFunction.kt @@ -1,4 +1,4 @@ -Deprecated("does nothing good") +@Deprecated("does nothing good") fun Any.doNothing() = this.toString() // "this" should not be marked as deprecated despite it referes to deprecated function // NO_CHECK_INFOS diff --git a/idea/testData/highlighter/deprecated/Function.kt b/idea/testData/highlighter/deprecated/Function.kt index 130ecf525a7..5048d727558 100644 --- a/idea/testData/highlighter/deprecated/Function.kt +++ b/idea/testData/highlighter/deprecated/Function.kt @@ -6,14 +6,14 @@ fun test() { test4(1, 2) } -Deprecated("Use A instead") fun test1() { } -Deprecated("Use A instead") fun test4(x: Int, y: Int) { x + y } +@Deprecated("Use A instead") fun test1() { } +@Deprecated("Use A instead") fun test4(x: Int, y: Int) { x + y } class MyClass() { - Deprecated("Use A instead") fun test2() {} + @Deprecated("Use A instead") fun test2() {} companion object { - Deprecated("Use A instead") fun test3() {} + @Deprecated("Use A instead") fun test3() {} } } diff --git a/idea/testData/highlighter/deprecated/Get.kt b/idea/testData/highlighter/deprecated/Get.kt index 7b384041c29..6999c072a3a 100644 --- a/idea/testData/highlighter/deprecated/Get.kt +++ b/idea/testData/highlighter/deprecated/Get.kt @@ -1,6 +1,6 @@ class MyClass {} -Deprecated("Use A instead") fun MyClass.get(i: MyClass): MyClass { return i } +@Deprecated("Use A instead") fun MyClass.get(i: MyClass): MyClass { return i } fun test() { val x1 = MyClass() diff --git a/idea/testData/highlighter/deprecated/Getter.kt b/idea/testData/highlighter/deprecated/Getter.kt index cda4eda23c7..574604ca3be 100644 --- a/idea/testData/highlighter/deprecated/Getter.kt +++ b/idea/testData/highlighter/deprecated/Getter.kt @@ -14,7 +14,7 @@ class MyClass() { public var test2: String = "" @Deprecated("Use A instead") get - Deprecated("Use A instead") public val test3: String = "" + @Deprecated("Use A instead") public val test3: String = "" @Deprecated("Use A instead") get } diff --git a/idea/testData/highlighter/deprecated/Inc.kt b/idea/testData/highlighter/deprecated/Inc.kt index d68c3c74e2e..374260bfc0b 100644 --- a/idea/testData/highlighter/deprecated/Inc.kt +++ b/idea/testData/highlighter/deprecated/Inc.kt @@ -2,7 +2,7 @@ class MyClass { val i = 0 } -Deprecated("Use A instead") fun MyClass.inc(): MyClass { return MyClass() } +@Deprecated("Use A instead") fun MyClass.inc(): MyClass { return MyClass() } fun test() { var x3 = MyClass() diff --git a/idea/testData/highlighter/deprecated/Invalid.kt b/idea/testData/highlighter/deprecated/Invalid.kt index fbfea552fe1..6b6d16de6f6 100644 --- a/idea/testData/highlighter/deprecated/Invalid.kt +++ b/idea/testData/highlighter/deprecated/Invalid.kt @@ -1,6 +1,6 @@ -Deprecated() +@Deprecated() fun foo() {} -Deprecated(false) +@Deprecated(false) fun boo() {} fun far() = foo() diff --git a/idea/testData/highlighter/deprecated/Invoke.kt b/idea/testData/highlighter/deprecated/Invoke.kt index 2772dcd2ae3..c72707e942d 100644 --- a/idea/testData/highlighter/deprecated/Invoke.kt +++ b/idea/testData/highlighter/deprecated/Invoke.kt @@ -1,6 +1,6 @@ class MyRunnable() {} -Deprecated("Use A instead") fun MyRunnable.invoke() { +@Deprecated("Use A instead") fun MyRunnable.invoke() { } fun test() { diff --git a/idea/testData/highlighter/deprecated/Operation.kt b/idea/testData/highlighter/deprecated/Operation.kt index b4980c31216..ef759e99b8f 100644 --- a/idea/testData/highlighter/deprecated/Operation.kt +++ b/idea/testData/highlighter/deprecated/Operation.kt @@ -2,18 +2,18 @@ class MyClass { val i = 0 } -Deprecated("Use A instead") fun MyClass.minus(i: MyClass) { i.i } -Deprecated("Use A instead") fun MyClass.div(i: MyClass) { i.i } -Deprecated("Use A instead") fun MyClass.times(i: MyClass) { i.i } +@Deprecated("Use A instead") fun MyClass.minus(i: MyClass) { i.i } +@Deprecated("Use A instead") fun MyClass.div(i: MyClass) { i.i } +@Deprecated("Use A instead") fun MyClass.times(i: MyClass) { i.i } -Deprecated("Use A instead") fun MyClass.not() { } -Deprecated("Use A instead") fun MyClass.plus() { } +@Deprecated("Use A instead") fun MyClass.not() { } +@Deprecated("Use A instead") fun MyClass.plus() { } -Deprecated("Use A instead") fun MyClass.contains(i: MyClass): Boolean { i.i; return false } +@Deprecated("Use A instead") fun MyClass.contains(i: MyClass): Boolean { i.i; return false } -Deprecated("Use A instead") fun MyClass.plusAssign(i: MyClass) { i.i } +@Deprecated("Use A instead") fun MyClass.plusAssign(i: MyClass) { i.i } -Deprecated("Use A instead") fun MyClass.rangeTo(i: MyClass): IntRange { return IntRange(i.i, i.i) } +@Deprecated("Use A instead") fun MyClass.rangeTo(i: MyClass): IntRange { return IntRange(i.i, i.i) } fun test() { val x1 = MyClass() diff --git a/idea/testData/highlighter/deprecated/Property.kt b/idea/testData/highlighter/deprecated/Property.kt index e07f65e2813..144887263ea 100644 --- a/idea/testData/highlighter/deprecated/Property.kt +++ b/idea/testData/highlighter/deprecated/Property.kt @@ -8,16 +8,16 @@ fun test() { MyClass.test6 } -Deprecated("Use A instead") val test1: String = "" -Deprecated("Use A instead") var test4: String = "" +@Deprecated("Use A instead") val test1: String = "" +@Deprecated("Use A instead") var test4: String = "" class MyClass() { - Deprecated("Use A instead") val test2: String = "" - Deprecated("Use A instead") var test5: String = "" + @Deprecated("Use A instead") val test2: String = "" + @Deprecated("Use A instead") var test5: String = "" companion object { - Deprecated("Use A instead") val test3: String = "" - Deprecated("Use A instead") var test6: String = "" + @Deprecated("Use A instead") val test3: String = "" + @Deprecated("Use A instead") var test6: String = "" } } diff --git a/idea/testData/highlighter/deprecated/RangeTo.kt b/idea/testData/highlighter/deprecated/RangeTo.kt index d0eafaf4b95..39df32d1f93 100644 --- a/idea/testData/highlighter/deprecated/RangeTo.kt +++ b/idea/testData/highlighter/deprecated/RangeTo.kt @@ -2,7 +2,7 @@ class MyClass { val i = 1 } -Deprecated("Use A instead") fun MyClass.rangeTo(i: MyClass): Iterable { +@Deprecated("Use A instead") fun MyClass.rangeTo(i: MyClass): Iterable { i.i throw Exception() } diff --git a/idea/testData/highlighter/deprecated/Trait.kt b/idea/testData/highlighter/deprecated/Trait.kt index 599fd096239..e22d769027b 100644 --- a/idea/testData/highlighter/deprecated/Trait.kt +++ b/idea/testData/highlighter/deprecated/Trait.kt @@ -1,4 +1,4 @@ -Deprecated("Use A instead") interface MyTrait { } +@Deprecated("Use A instead") interface MyTrait { } fun test() { val a: MyTrait? = null