diff --git a/compiler/testData/cli/js/diagnosticForUnhandledElements.kt b/compiler/testData/cli/js/diagnosticForUnhandledElements.kt index 5eafcb31095..5a7883465d0 100644 --- a/compiler/testData/cli/js/diagnosticForUnhandledElements.kt +++ b/compiler/testData/cli/js/diagnosticForUnhandledElements.kt @@ -2,10 +2,10 @@ package foo annotation class fancy -[fancy] +@fancy class Foo { - [fancy] - fun baz([fancy] foo : Int) : Int { - return [fancy] 1 + @fancy + fun baz(@fancy foo : Int) : Int { + return (@fancy 1) } } diff --git a/compiler/testData/cli/js/diagnosticForUnhandledElements.out b/compiler/testData/cli/js/diagnosticForUnhandledElements.out index c2a6a5cd944..f1556bb1ee8 100644 --- a/compiler/testData/cli/js/diagnosticForUnhandledElements.out +++ b/compiler/testData/cli/js/diagnosticForUnhandledElements.out @@ -1,3 +1,3 @@ -WARNING: compiler/testData/cli/js/diagnosticForUnhandledElements.kt: (8, 21) Parameter 'foo' is never used -ERROR: compiler/testData/cli/js/diagnosticForUnhandledElements.kt: (9, 16) Cannot translate (not supported yet): '[fancy] 1' -COMPILATION_ERROR +WARNING: compiler/testData/cli/js/diagnosticForUnhandledElements.kt: (8, 20) Parameter 'foo' is never used +ERROR: compiler/testData/cli/js/diagnosticForUnhandledElements.kt: (9, 17) Cannot translate (not supported yet): '@fancy 1' +COMPILATION_ERROR \ No newline at end of file diff --git a/compiler/testData/cli/jvm/androidPlugin/androidApp.kt b/compiler/testData/cli/jvm/androidPlugin/androidApp.kt index 5ae840472ca..a548af87d96 100644 --- a/compiler/testData/cli/jvm/androidPlugin/androidApp.kt +++ b/compiler/testData/cli/jvm/androidPlugin/androidApp.kt @@ -1,7 +1,7 @@ package android.app public open class Activity { - public open fun findViewById([suppress("UNUSED_PARAMETER")] id: Int): android.view.View = null!! + public open fun findViewById(@suppress("UNUSED_PARAMETER") id: Int): android.view.View = null!! } public open class Fragment { diff --git a/compiler/testData/cli/jvm/androidPlugin/androidView.kt b/compiler/testData/cli/jvm/androidPlugin/androidView.kt index 873d04cca35..4fed644ab23 100644 --- a/compiler/testData/cli/jvm/androidPlugin/androidView.kt +++ b/compiler/testData/cli/jvm/androidPlugin/androidView.kt @@ -1,5 +1,5 @@ package android.view public open class View { - public open fun findViewById([suppress("UNUSED_PARAMETER")] id: Int): android.view.View = null!! + public open fun findViewById(@suppress("UNUSED_PARAMETER") id: Int): android.view.View = null!! } \ No newline at end of file diff --git a/compiler/testData/cli/jvm/androidPlugin/androidWidget.kt b/compiler/testData/cli/jvm/androidPlugin/androidWidget.kt index 57c6d10400d..137ff839f0e 100644 --- a/compiler/testData/cli/jvm/androidPlugin/androidWidget.kt +++ b/compiler/testData/cli/jvm/androidPlugin/androidWidget.kt @@ -1,5 +1,5 @@ package android.widget public open class TextView : android.view.View() { - public fun setText([suppress("UNUSED_PARAMETER")] text: String) {} + public fun setText(@suppress("UNUSED_PARAMETER") text: String) {} } \ No newline at end of file diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNonTailRecursions.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNonTailRecursions.kt index 18b9445f14f..5c51281a46d 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNonTailRecursions.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNonTailRecursions.kt @@ -3,7 +3,7 @@ tailRecursive fun badTails(x : Int) : Int { return 1 + badTails(x - 1) } else if (x == 10) { - [suppress("NON_TAIL_RECURSIVE_CALL")] + @suppress("NON_TAIL_RECURSIVE_CALL") return 1 + badTails(x - 1) } else if (x >= 50) { return badTails(x - 1) diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveInnerFunction.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveInnerFunction.kt index 7b5af7792dd..4dc15487722 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveInnerFunction.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveInnerFunction.kt @@ -1,5 +1,5 @@ fun test() { - [tailRecursive] fun g3(counter : Int) { + @tailRecursive fun g3(counter : Int) { if (counter > 0) { g3(counter - 1) } } g3(1000000) diff --git a/compiler/testData/diagnostics/tests/Casts.kt b/compiler/testData/diagnostics/tests/Casts.kt index 9c98b7b0a3c..46f575f2730 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() + (@data()( "" as String?))?.length() Unit } diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationsForClasses.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationsForClasses.kt index 93d889cb476..7bc136a5558 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationsForClasses.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationsForClasses.kt @@ -1,2 +1,2 @@ -annotation [java.lang.Deprecated] class my +annotation @java.lang.Deprecated class my annotation Deprecated class my1 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/DanglingInScript.kt b/compiler/testData/diagnostics/tests/annotations/DanglingInScript.kt index b50e4261612..e5ea165258e 100644 --- a/compiler/testData/diagnostics/tests/annotations/DanglingInScript.kt +++ b/compiler/testData/diagnostics/tests/annotations/DanglingInScript.kt @@ -2,4 +2,4 @@ annotation class Ann -[Ann] \ No newline at end of file +@Ann \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/DanglingMixed.kt b/compiler/testData/diagnostics/tests/annotations/DanglingMixed.kt index 285234d5c68..c7c019ed5f8 100644 --- a/compiler/testData/diagnostics/tests/annotations/DanglingMixed.kt +++ b/compiler/testData/diagnostics/tests/annotations/DanglingMixed.kt @@ -5,18 +5,18 @@ class C { fun foo() { class Local { Ann0 - [Ann Ann3] + @Ann @Ann3 Ann2(1) - [Ann4] + @Ann4 } } Ann0 - [Ann Ann3] + @Ann @Ann3 Ann2(1) - [Ann4] + @Ann4 } Ann0 -[Ann Ann3] -Ann2(1) -[Ann4] \ No newline at end of file +@Ann @Ann3 +@Ann2(1) +@Ann4 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.kt b/compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.kt index d742c7213f1..8a0f5e78d5f 100644 --- a/compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.kt +++ b/compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.kt @@ -2,15 +2,15 @@ annotation class Ann class C { fun test() { - [Ann] + @Ann } fun foo() { class Local { - [Ann] + @Ann } } - [Ann] + @Ann } -[Ann] \ No newline at end of file +@Ann \ 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 fc91850664c..bbab0f2144b 100644 --- a/compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.kt +++ b/compiler/testData/diagnostics/tests/annotations/JavaAnnotationConstructors.kt @@ -1,4 +1,4 @@ import java.lang.annotation.* -annotation [java.lang.annotation.Retention(RetentionPolicy.CLASS)] class my +annotation @java.lang.annotation.Retention(RetentionPolicy.CLASS) class my annotation Retention(RetentionPolicy.RUNTIME) Target(ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR) class my1 diff --git a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/booleanLocalVal.kt b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/booleanLocalVal.kt index 2dceb9d8f11..cd939098784 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/booleanLocalVal.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/booleanLocalVal.kt @@ -2,5 +2,5 @@ annotation class Ann(vararg val i: Boolean) fun foo() { val bool1 = true - [Ann(bool1)] val a = bool1 + @Ann(bool1) val a = bool1 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/compareAndEquals.kt b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/compareAndEquals.kt index c039b0a6299..dac0379704d 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/compareAndEquals.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/compareAndEquals.kt @@ -6,11 +6,11 @@ fun foo() { val a3 = a1 == a2 val a4 = a1 > a2 - [Ann( + @Ann( a1, a2, a3, a1 > a2, a1 == a2 - )] val b = 1 + ) val b = 1 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/strings.kt b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/strings.kt index edd87b20f9d..630a3bbdd54 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/strings.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationParameterMustBeConstant/strings.kt @@ -11,7 +11,7 @@ fun foo() { val a4 = 1 val a5 = 1.0 - [Ann( + @Ann( a1, a2, a3, @@ -24,5 +24,5 @@ fun foo() { "a" + a2, "a" + topLevel, "a" + a4 - )] val b = 1 + ) val b = 1 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/annotationsOnLambdaAsCallArgument.kt b/compiler/testData/diagnostics/tests/annotations/annotationsOnLambdaAsCallArgument.kt index 523b794eadb..352a0d9fe3f 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationsOnLambdaAsCallArgument.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationsOnLambdaAsCallArgument.kt @@ -3,7 +3,7 @@ annotation class Ann(val x: Int = 1) inline fun bar(block: () -> Int): Int = block() fun foo() { - bar() [Ann(1)] @Ann(2) { 101 } + bar() @Ann(1) @Ann(2) { 101 } bar() @Ann(3) { 102 } bar @Ann l1@ { diff --git a/compiler/testData/diagnostics/tests/annotations/atAnnotationResolve.kt b/compiler/testData/diagnostics/tests/annotations/atAnnotationResolve.kt index 6ddc591fa9c..2a0718c2716 100644 --- a/compiler/testData/diagnostics/tests/annotations/atAnnotationResolve.kt +++ b/compiler/testData/diagnostics/tests/annotations/atAnnotationResolve.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER annotation class Ann(val x: Int = 6) -@Ann(1) [Ann(2)] @Ann(3) @private class A [Ann] () { +@Ann(1) @Ann(2) @Ann(3) @private class A [Ann] () { @Ann(x = 5) fun foo() { 1 + @Ann(1) 1 * @Ann("") 6 @@ -10,5 +10,5 @@ annotation class Ann(val x: Int = 6) @Ann val x = 1 - fun bar(x: @Ann(1) [Ann(2)] @Ann(3) Int) {} + fun bar(x: @Ann(1) @Ann(2) @Ann(3) Int) {} } diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt index a97b9c33187..d6a1e48a525 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt @@ -3,7 +3,7 @@ fun foo(varargs f : Int) {} var bar : Int = 1 set(varargs v) {} -val x : (Int) -> Int = {[varargs] x : Int -> x} +val x : (Int) -> Int = {@varargs x : Int -> x} 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 18694b06f0c..c23fa9142a0 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt @@ -5,7 +5,7 @@ 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 +val x : (Int) -> Int = {@test x : Int -> x} // todo fix parser annotation on lambda parameter class Hello(test args: Any) { } diff --git a/compiler/testData/diagnostics/tests/annotations/onExpression.kt b/compiler/testData/diagnostics/tests/annotations/onExpression.kt index 219e434aeb4..72697adbaf5 100644 --- a/compiler/testData/diagnostics/tests/annotations/onExpression.kt +++ b/compiler/testData/diagnostics/tests/annotations/onExpression.kt @@ -1,3 +1,3 @@ -fun foo() = [ann] 1 +fun foo() = @ann 1 annotation class ann \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/onFunctionParameter.kt b/compiler/testData/diagnostics/tests/annotations/onFunctionParameter.kt index ddb4c91694f..cbf9a208e8b 100644 --- a/compiler/testData/diagnostics/tests/annotations/onFunctionParameter.kt +++ b/compiler/testData/diagnostics/tests/annotations/onFunctionParameter.kt @@ -1,9 +1,9 @@ annotation class ann -fun test([ann] p: Int) { +fun test(@ann p: Int) { } -val bar = fun test([ann] g: Int) {} +val bar = fun test(@ann g: Int) {} -val bas = { ([ann] t: Int) -> } \ No newline at end of file +val bas = { (@ann t: Int) -> } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/onInitializer.kt b/compiler/testData/diagnostics/tests/annotations/onInitializer.kt index 80e3b065fda..0cf9234c4e7 100644 --- a/compiler/testData/diagnostics/tests/annotations/onInitializer.kt +++ b/compiler/testData/diagnostics/tests/annotations/onInitializer.kt @@ -1,15 +1,15 @@ class A { ann init {} - [ann] init {} + @ann init {} aaa init {} - [aaa] init {} + @aaa init {} } trait T { ann init {} - [ann] init {} + @ann init {} aaa init {} - [aaa] init {} + @aaa init {} } annotation class ann \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/onLoops.kt b/compiler/testData/diagnostics/tests/annotations/onLoops.kt index 954c7050f19..2ec18eb93d2 100644 --- a/compiler/testData/diagnostics/tests/annotations/onLoops.kt +++ b/compiler/testData/diagnostics/tests/annotations/onLoops.kt @@ -1,11 +1,11 @@ fun test() { - [ann] + @ann while (2 < 1) {} - [ann] + @ann do {} while (2 < 1) - [ann] + @ann for (i in 1..2) {} } diff --git a/compiler/testData/diagnostics/tests/annotations/onLoopsUnreachable.kt b/compiler/testData/diagnostics/tests/annotations/onLoopsUnreachable.kt index 0ac9390d72a..460bccc8094 100644 --- a/compiler/testData/diagnostics/tests/annotations/onLoopsUnreachable.kt +++ b/compiler/testData/diagnostics/tests/annotations/onLoopsUnreachable.kt @@ -1,11 +1,11 @@ fun test() { - [ann] + @ann while (2 > 1) {} - [ann] + @ann do {} while (2 > 1) - [ann] + @ann for (i in 1..2) {} } diff --git a/compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt b/compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt index 5a3b10cc898..b9c8cf57036 100644 --- a/compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt +++ b/compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.kt @@ -1,5 +1,5 @@ fun test(): Any? { - [ann] val (a, b) = P(1, 1) + @ann val (a, b) = P(1, 1) return a + b } diff --git a/compiler/testData/diagnostics/tests/annotations/typeAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/typeAnnotations.kt index f4b1e279a11..81718795d30 100644 --- a/compiler/testData/diagnostics/tests/annotations/typeAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/typeAnnotations.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER class A -fun [x] A.foo(a: [x] Int) { - val v: [x] Int = 1 +fun @x A.foo(a: @x Int) { + val v: @x Int = 1 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/typeParameterAsAnnotation.kt b/compiler/testData/diagnostics/tests/annotations/typeParameterAsAnnotation.kt index 355f4e5898a..318b67e12e9 100644 --- a/compiler/testData/diagnostics/tests/annotations/typeParameterAsAnnotation.kt +++ b/compiler/testData/diagnostics/tests/annotations/typeParameterAsAnnotation.kt @@ -1,9 +1,9 @@ class Foo { - [T] + @T fun foo() = 0 } class Bar { - [T] + @T fun foo() = 0 } \ 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 cb041888d74..70c6bd895de 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.kt @@ -6,20 +6,20 @@ trait B fun A.() {} a fun () {} -fun [a] A.() {} +fun @a A.() {} class Outer { fun () {} fun B.() {} a fun () {} - fun [a] A.() {} + fun @a A.() {} } fun outerFun() { fun () {} fun B.() {} - [a] fun () {} - fun [a] A.() {} + @a fun () {} + fun @a A.() {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deprecated/javaDeprecated.kt b/compiler/testData/diagnostics/tests/deprecated/javaDeprecated.kt index 4ff1e8152ca..9a2e45e95ed 100644 --- a/compiler/testData/diagnostics/tests/deprecated/javaDeprecated.kt +++ b/compiler/testData/diagnostics/tests/deprecated/javaDeprecated.kt @@ -11,6 +11,6 @@ public class A { // FILE: B.kt -class B(private [deprecated] val foo: String) : A() { +class B(private @deprecated val foo: String) : A() { override fun getFoo(text: String): String = super.getFoo(text + foo) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt b/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt index 6b4b08cd225..c9bbf666db8 100644 --- a/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt @@ -19,19 +19,19 @@ class PropertyHolder { var varDelegate by Delegate() public val test1: String = "" - [deprecated("val-getter")] get + @deprecated("val-getter") get public var test2: String = "" - [deprecated("var-getter")] get - [deprecated("var-setter")] set + @deprecated("var-getter") get + @deprecated("var-setter") set public var test3: String = "" - [deprecated("var-getter")] get + @deprecated("var-getter") get set public var test4: String = "" get - [deprecated("var-setter")] set + @deprecated("var-setter") set } fun PropertyHolder.extFunction() { diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/Common.kt b/compiler/testData/diagnostics/tests/functionAsExpression/Common.kt index 61aea2fed72..11534e39e6e 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/Common.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/Common.kt @@ -11,7 +11,7 @@ val extensionWithName = fun A.name() {} val withoutName = fun () {} val extensionWithoutName = fun A.() {} -fun withAnnotation() = [ann(ok)] fun () {} +fun withAnnotation() = @ann(ok) fun () {} val withReturn = fun (): Int { return 5} val withExpression = fun() = 5 val funfun = fun() = fun() = 5 diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/WithoutBody.kt b/compiler/testData/diagnostics/tests/functionAsExpression/WithoutBody.kt index f4e887edb4d..07692a43fd2 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/WithoutBody.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/WithoutBody.kt @@ -8,5 +8,5 @@ fun bar(a: Any) = fun name() fun outer() { bar(fun ()) bar(fun name()) - bar([ann] fun name()) + bar(@ann fun name()) } \ 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 7200730dd2e..ef75045210a 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/nonPublicMember/localClass2.kt b/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass2.kt index b87fd9c9cb6..1cb8fc0ca75 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 f6942795427..2ee86c0a7c9 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/inner/classesInClassObjectHeader.kt b/compiler/testData/diagnostics/tests/inner/classesInClassObjectHeader.kt index 750f34289b6..426e478525f 100644 --- a/compiler/testData/diagnostics/tests/inner/classesInClassObjectHeader.kt +++ b/compiler/testData/diagnostics/tests/inner/classesInClassObjectHeader.kt @@ -1,5 +1,5 @@ class Test { - [`InnerAnnotation`InnerAnnotation] + @`InnerAnnotation` @InnerAnnotation companion object : StaticClass(), InnerClass() { } diff --git a/compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.kt b/compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.kt index 99b6d0f6f58..1cef44cfccd 100644 --- a/compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.kt +++ b/compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.kt @@ -1,4 +1,4 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER +// !DIAGNOSTICS: -UNUSED_PARAMETER -DEPRECATED_ANNOTATION_SYNTAX annotation class Ann fun bar(block: (T) -> Int) {} diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.kt index d3fc5cdb91d..4038d0ba246 100644 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.kt +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.kt @@ -1,4 +1,4 @@ fun foo() { - [suppress("warnings")] + @suppress("warnings") ("": String??) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt index 8a34209758d..840ddab707f 100644 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt @@ -1,5 +1,5 @@ class C { val foo: String? - [suppress("warnings")] + @suppress("warnings") get(): String?? = null as Nothing? } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/manyWarnings/onExpression.kt b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onExpression.kt index c6c62c4941d..686aec64a4c 100644 --- a/compiler/testData/diagnostics/tests/suppress/manyWarnings/onExpression.kt +++ b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onExpression.kt @@ -1,4 +1,4 @@ fun foo(): Any? { - [suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")] + @suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION") return ""!! as String?? } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/manyWarnings/onPropertyAccessor.kt b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onPropertyAccessor.kt index a8f717b2366..460f56433b2 100644 --- a/compiler/testData/diagnostics/tests/suppress/manyWarnings/onPropertyAccessor.kt +++ b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onPropertyAccessor.kt @@ -1,5 +1,5 @@ class C { val foo: String? - [suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")] + @suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION") get(): String?? = ""!! as String?? } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/onExpression.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/onExpression.kt index 67a90726834..798fcbb57ab 100644 --- a/compiler/testData/diagnostics/tests/suppress/oneWarning/onExpression.kt +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/onExpression.kt @@ -1,4 +1,4 @@ fun foo(): Any? { - [suppress("REDUNDANT_NULLABLE")] + @suppress("REDUNDANT_NULLABLE") return null as Nothing?? } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/onLocalVariable.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/onLocalVariable.kt index 0047969f4f1..0fee757e609 100644 --- a/compiler/testData/diagnostics/tests/suppress/oneWarning/onLocalVariable.kt +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/onLocalVariable.kt @@ -1,6 +1,6 @@ class C { fun foo(): Any? { - [suppress("REDUNDANT_NULLABLE")] + @suppress("REDUNDANT_NULLABLE") val v: String?? = null as Nothing?? return v } diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/onPropertyAccessor.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/onPropertyAccessor.kt index f51bae07550..b54c8a38792 100644 --- a/compiler/testData/diagnostics/tests/suppress/oneWarning/onPropertyAccessor.kt +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/onPropertyAccessor.kt @@ -1,5 +1,5 @@ class C { val foo: String? - [suppress("REDUNDANT_NULLABLE")] + @suppress("REDUNDANT_NULLABLE") get(): String?? = null as Nothing?? } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt b/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt index 410dc44d3fa..cc1c5c9db55 100644 --- a/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt +++ b/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt @@ -1,5 +1,5 @@ fun foo(a: Int) { - [ann] + @ann when (a) { 1 -> {} } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/overloading.kt b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/overloading.kt index 9ad15efcb6f..54cfb300ec1 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/overloading.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/overloading.kt @@ -19,5 +19,5 @@ fun test(d: dynamic) { // Checking specificity of `dynamic` vs `Nothing` nothing(d).checkType { _() } nothing("").checkType { _() } - [suppress("UNREACHABLE_CODE")] nothing(null!!).checkType { _() } + @suppress("UNREACHABLE_CODE") nothing(null!!).checkType { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalExtensionFun.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalExtensionFun.kt index 423ca603fe3..8d70bb60f54 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalExtensionFun.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalExtensionFun.kt @@ -1,24 +1,24 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo() { - [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.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" - [nativeGetter] + @nativeGetter fun Any.foo(a: Int = 1): Any? = "OK" } \ 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 4b90bfcf2c8..9357f43b2c8 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalNativeClassMembers.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo() { - [native] + @native class A { nativeGetter fun get(a: String): Any? = null @@ -13,13 +13,13 @@ fun foo() { fun foo(a: Double): String? = null } - [native] + @native class B { nativeGetter val foo = 0 } - [native] + @native class C { nativeGetter fun Int.get(a: String): Int? = 1 diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalOtherDeclarations.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalOtherDeclarations.kt index 3f0754a7712..f9d5eaf5ea8 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalOtherDeclarations.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeGetter/onLocalOtherDeclarations.kt @@ -1,12 +1,12 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -NON_TOPLEVEL_CLASS_DECLARATION fun foo() { - [nativeGetter] + @nativeGetter fun toplevelFun(): Any = 0 - [nativeGetter] + @nativeGetter val toplevelVal = 0 - [nativeGetter] + @nativeGetter class Foo {} } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalExtensionFun.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalExtensionFun.kt index 38158509724..2830b6bdcc3 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalExtensionFun.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalExtensionFun.kt @@ -1,9 +1,9 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo() { - [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/onLocalNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalNativeClassMembers.kt index 808db78d583..c38123a503b 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalNativeClassMembers.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo() { - [native] + @native class A { nativeInvoke fun foo() {} diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalOtherDeclarations.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalOtherDeclarations.kt index d7904aa17f0..b5835ee3232 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalOtherDeclarations.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onLocalOtherDeclarations.kt @@ -1,12 +1,12 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -NON_TOPLEVEL_CLASS_DECLARATION fun foo() { - [nativeInvoke] + @nativeInvoke fun toplevelFun() {} - [nativeInvoke] + @nativeInvoke val toplevelVal = 0 - [nativeInvoke] + @nativeInvoke class Foo {} } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalExtensionFun.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalExtensionFun.kt index 64c689af8d6..81cdf915f1c 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalExtensionFun.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalExtensionFun.kt @@ -1,33 +1,33 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo() { - [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 Int.set(a: Any): Int? = 1 - [nativeSetter] + @nativeSetter fun Int.set2(): String? = "OK" - [nativeSetter] + @nativeSetter fun Int.set3(a: Any, b: Int, c: Any?) {} - [nativeSetter] + @nativeSetter fun Any.foo(a: Double = 0.0, v: String? = null) = "OK" } \ 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 7950f5db146..9fecc00232c 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNativeClassMembers.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo() { - [native] + @native class A { nativeSetter fun set(a: String, v: Any?): Any? = null @@ -19,13 +19,13 @@ fun foo() { fun set5(a: Double, v: String): CharSequence = "OK" } - [native] + @native class B { nativeSetter val foo = 0 } - [native] + @native class C { nativeSetter fun Int.set(a: String, v: Int) {} @@ -51,10 +51,10 @@ fun foo() { nativeSetter fun set(a: A, v: Any?) {} - [nativeSetter] + @nativeSetter fun foo(a: Number = 0.0, v: String) = "OK" - [nativeSetter] + @nativeSetter fun boo(a: Number, v: String = "str") = "OK" } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNonNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNonNativeClassMembers.kt index 944e580a355..7e4c636c109 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNonNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalNonNativeClassMembers.kt @@ -39,7 +39,7 @@ fun foo() { nativeSetter fun set(a: A, v: Any?) {} - [nativeSetter] + @nativeSetter fun foo(a: Int = 0, v: String) = "OK" } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalOtherDeclarations.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalOtherDeclarations.kt index 4ad43ce1a11..9218571b40a 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalOtherDeclarations.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onLocalOtherDeclarations.kt @@ -1,12 +1,12 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -NON_TOPLEVEL_CLASS_DECLARATION fun foo() { - [nativeSetter] + @nativeSetter fun toplevelFun(): Any = 0 - [nativeSetter] + @nativeSetter val toplevelVal = 0 - [nativeSetter] + @nativeSetter class Foo {} } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNativeClassMembers.kt index 26af65cd3e5..f2b351d7321 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNativeClassMembers.kt @@ -78,6 +78,6 @@ class C { nativeSetter fun set(a: A, v: Any?) {} - [nativeSetter] + @nativeSetter fun foo(a: Number, v: String = "aa") = "OK" } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNativeClass.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNativeClass.kt index ba1af5aa1e1..5168e968300 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNativeClass.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNativeClass.kt @@ -78,7 +78,7 @@ class A { nativeSetter fun set(a: A, v: Any?) {} - [nativeSetter] + @nativeSetter fun foo(a: Double = 0.0, v: String = "str") = "OK" } @@ -104,7 +104,7 @@ class A { nativeSetter fun set(a: A, v: Any?) {} - [nativeSetter] + @nativeSetter fun foo(a: Int, v: String = "str") = "OK" } @@ -130,7 +130,7 @@ class A { nativeSetter fun set(a: A, v: Any?) {} - [nativeSetter] + @nativeSetter fun foo(a: Number = 0.0, v: String) = "OK" } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNonNativeClass.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNonNativeClass.kt index 188f93de162..d03859d3978 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNonNativeClass.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNestedDeclarationsInsideNonNativeClass.kt @@ -71,7 +71,7 @@ class A { nativeSetter fun set(a: A, v: Any?) {} - [nativeSetter] + @nativeSetter fun foo(a: Double = 0.0, v: String = "str") = "OK" } @@ -97,7 +97,7 @@ class A { nativeSetter fun set(a: A, v: Any?) {} - [nativeSetter] + @nativeSetter fun foo(a: Int, v: String = "str") = "OK" } @@ -123,7 +123,7 @@ class A { nativeSetter fun set(a: A, v: Any?) {} - [nativeSetter] + @nativeSetter fun foo(a: Number = 0.0, v: String) = "OK" } } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNonNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNonNativeClassMembers.kt index f16eec5a97b..85765574165 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNonNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeSetter/onNonNativeClassMembers.kt @@ -60,6 +60,6 @@ class C { nativeSetter fun set(a: A, v: Any?) {} - [nativeSetter] + @nativeSetter fun foo(a: String = "0.0", v: String) = "OK" } \ 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 dcb9faf69a7..5aaac4d22ca 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/native.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/native.kt @@ -59,7 +59,7 @@ object O { } fun test() { - [native] + @native class Local { val baz: Int val boo: Int = noImpl diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/illegalPlatformName.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/illegalPlatformName.kt index a799dd1a61e..bf598a5c586 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/illegalPlatformName.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/illegalPlatformName.kt @@ -1,14 +1,14 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.platform.* -[platformName("")] +@platformName("") fun foo(a: Any) {} -[platformName(".")] +@platformName(".") fun foo() {} -[platformName("/")] +@platformName("/") fun fooSlash() {} -[platformName("<")] +@platformName("<") fun fooLT() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/platformName.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/platformName.kt index c92b0340c48..391359c3045 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/platformName.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/platformName.kt @@ -2,66 +2,66 @@ import kotlin.platform.* -[platformName("a")] +@platformName("a") fun foo() {} -[platformName("b")] +@platformName("b") fun Any.foo() {} -[platformName("c")] +@platformName("c") val px = 1 -[platformName("d")] +@platformName("d") val Any.px : Int get() = 1 val valx: Int - [platformName("e")] + @platformName("e") get() = 1 var varx: Int - [platformName("f")] + @platformName("f") get() = 1 - [platformName("g")] + @platformName("g") set(v) {} var vardef: Int = 1 - [platformName("h")] + @platformName("h") get - [platformName("i")] + @platformName("i") set -[platformName("C")] +@platformName("C") class C [platformName("primary")]() { platformName("ctr") constructor(x: Int): this() {} - [platformName("a")] + @platformName("a") fun foo() {} - [platformName("b")] + @platformName("b") fun Any.foo() {} - [platformName("c")] + @platformName("c") val px = 1 - [platformName("d")] + @platformName("d") val Any.px : Int get() = 1 val valx: Int - [platformName("e")] + @platformName("e") get() = 1 var varx: Int - [platformName("f")] + @platformName("f") get() = 1 - [platformName("g")] + @platformName("g") set(v) {} } fun foo1() { - [platformName("a")] + @platformName("a") fun foo() {} - [platformName("a")] + @platformName("a") val x = 1 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt index 0534715242f..167492f03fd 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt @@ -6,18 +6,18 @@ public @interface A { } // FILE: b.kt -[A("1", "2", "3", y = 1)] fun test1() {} +@A("1", "2", "3", y = 1) fun test1() {} -[A("4", y = 2)] fun test2() {} +@A("4", y = 2) fun test2() {} -[A(*arrayOf("5", "6"), "7", y = 3)] fun test3() {} +@A(*arrayOf("5", "6"), "7", y = 3) fun test3() {} -[A("1", "2", "3", x = String::class, y = 4)] fun test4() {} +@A("1", "2", "3", x = String::class, y = 4) fun test4() {} -[A("4", y = 5)] fun test5() {} +@A("4", y = 5) fun test5() {} -[A(*arrayOf("5", "6"), "7", x = Any::class, y = 6)] fun test6() {} +@A(*arrayOf("5", "6"), "7", x = Any::class, y = 6) fun test6() {} -[A(y = 7)] fun test7() {} +@A(y = 7) fun test7() {} -[A("8", "9", "10")] fun test8() {} +@A("8", "9", "10") fun test8() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt index 0ba7da64a84..3d8cac42a35 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt @@ -6,22 +6,22 @@ public @interface A { } // FILE: b.kt -[A("1", "2", "3")] fun test1() {} +@A("1", "2", "3") fun test1() {} -[A("4")] fun test2() {} +@A("4") fun test2() {} -[A(*arrayOf("5", "6"), "7")] fun test3() {} +@A(*arrayOf("5", "6"), "7") fun test3() {} -[A("1", "2", "3", x = String::class)] fun test4() {} +@A("1", "2", "3", x = String::class) fun test4() {} -[A("4", y = 2)] fun test5() {} +@A("4", y = 2) fun test5() {} -[A(*arrayOf("5", "6"), "7", x = Any::class, y = 3)] fun test6() {} +@A(*arrayOf("5", "6"), "7", x = Any::class, y = 3) fun test6() {} -[A()] fun test7() {} +@A() fun test7() {} -[A] fun test8() {} +@A fun test8() {} -[A(x = Any::class, *arrayOf("5", "6"), "7", y = 3)] fun test9() {} -[A(x = Any::class, value = *arrayOf("5", "6"), "7", y = 3)] fun test10() {} -[A(x = Any::class, value = *arrayOf("5", "6", "7"), y = 3)] fun test11() {} +@A(x = Any::class, *arrayOf("5", "6"), "7", y = 3) fun test9() {} +@A(x = Any::class, value = *arrayOf("5", "6"), "7", y = 3) fun test10() {} +@A(x = Any::class, value = *arrayOf("5", "6", "7"), y = 3) fun test11() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefaultError.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefaultError.kt index 163eac28170..b51dd5d8d07 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefaultError.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefaultError.kt @@ -5,4 +5,4 @@ public @interface A { } // FILE: b.kt -[A(x = ; java.lang.Class)!>javaClass(), y = "")] fun test1() {} +@A(x = ; java.lang.Class)!>javaClass(), y = "") fun test1() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt index 821108cb093..7689996da60 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt @@ -4,12 +4,12 @@ public @interface A { } // FILE: b.kt -[A("1", "2", "3")] fun test1() {} +@A("1", "2", "3") fun test1() {} -[A("4")] fun test2() {} +@A("4") fun test2() {} -[A(*arrayOf("5", "6"), "7")] fun test3() {} +@A(*arrayOf("5", "6"), "7") fun test3() {} -[A()] fun test4() {} +@A() fun test4() {} -[A] fun test5() {} +@A fun test5() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.kt index 838cfc73f3a..7617ba14f5c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.kt @@ -4,12 +4,12 @@ public @interface A { } // FILE: b.kt -[A("1", "2", "3")] fun test1() {} +@A("1", "2", "3") fun test1() {} -[A("4")] fun test2() {} +@A("4") fun test2() {} -[A(*arrayOf("5", "6"), "7")] fun test3() {} +@A(*arrayOf("5", "6"), "7") fun test3() {} -[A()] fun test4() {} +@A() fun test4() {} -[A] fun test5() {} +@A fun test5() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt index 6417c8e6dd5..a99a0722e32 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt @@ -4,6 +4,6 @@ public @interface A { } // FILE: b.kt -[A(*; IGNORE)!>arrayOf(1, "b"))] +@A(*; IGNORE)!>arrayOf(1, "b")) fun test() { } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt index 62b21774167..4ddd7c32fd8 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt @@ -1,5 +1,5 @@ annotation class B(vararg val args: String) -[B(*; IGNORE)!>arrayOf(1, "b"))] +@B(*; IGNORE)!>arrayOf(1, "b")) fun test() { } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/JvmOverloadWithNoDefaults.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/JvmOverloadWithNoDefaults.kt index 72ed0c041df..b328ec43538 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/JvmOverloadWithNoDefaults.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/JvmOverloadWithNoDefaults.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER class C { - [kotlin.jvm.overloads] constructor() { + @kotlin.jvm.overloads constructor() { } - [kotlin.jvm.overloads] fun foo(s: String) {} + @kotlin.jvm.overloads fun foo(s: String) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/jvmOverloadsOnAbstractMethods.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/jvmOverloadsOnAbstractMethods.kt index 571c6ba0e53..2d72d8da6ad 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/jvmOverloadsOnAbstractMethods.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/jvmOverloadsOnAbstractMethods.kt @@ -1,8 +1,8 @@ trait T { - [kotlin.jvm.overloads] fun foo(s: String = "OK") + @kotlin.jvm.overloads fun foo(s: String = "OK") } abstract class C { - [kotlin.jvm.overloads] abstract fun foo(s: String = "OK") + @kotlin.jvm.overloads abstract fun foo(s: String = "OK") } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/jvmOverloadsOnPrivate.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/jvmOverloadsOnPrivate.kt index df575fc2c02..123851f98d2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/jvmOverloadsOnPrivate.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmOverloads/jvmOverloadsOnPrivate.kt @@ -1,20 +1,20 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER class C { - [kotlin.jvm.overloads] private fun foo(s: String = "OK") { + @kotlin.jvm.overloads private fun foo(s: String = "OK") { } - [kotlin.jvm.overloads] fun bar(s: String = "OK") { + @kotlin.jvm.overloads fun bar(s: String = "OK") { } } fun foo() { class D { - [kotlin.jvm.overloads] fun foo(s: String = "OK") { + @kotlin.jvm.overloads fun foo(s: String = "OK") { } } val x = object { - [kotlin.jvm.overloads] fun foo(s: String = "OK") { + @kotlin.jvm.overloads fun foo(s: String = "OK") { } } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/finalAndAbstract.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/finalAndAbstract.kt index a3e73216a62..2c366bebbf9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/finalAndAbstract.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/finalAndAbstract.kt @@ -12,24 +12,24 @@ abstract class A { object B: A() { - [platformStatic] override fun a() {} + @platformStatic override fun a() {} - [platformStatic] override fun b() {} + @platformStatic override fun b() {} - [platformStatic] final override fun c() {} + @platformStatic final override fun c() {} - [platformStatic] open fun d() {} + @platformStatic open fun d() {} } class C { companion object: A() { - [platformStatic] override fun a() {} + @platformStatic override fun a() {} - [platformStatic] override fun b() {} + @platformStatic override fun b() {} - [platformStatic] final override fun c() {} + @platformStatic final override fun c() {} - [platformStatic] open fun d() {} + @platformStatic open fun d() {} } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/localFun.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/localFun.kt index dde1d016ce3..d07a28619a3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/localFun.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/localFun.kt @@ -2,7 +2,7 @@ import kotlin.platform.platformStatic fun main(args: Array) { - [platformStatic] fun a(){ + @platformStatic fun a(){ } } \ 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 d0bd5676c75..1e61dd96bcf 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/property.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/platformStatic/property.kt @@ -9,38 +9,38 @@ open class B { class A { companion object : B() { var p1:Int = 1 - [platformStatic] set(p: Int) { + @platformStatic set(p: Int) { p1 = 1 } - [platformStatic] val z = 1; + @platformStatic val z = 1; - [platformStatic] override val base1: Int = 0 + @platformStatic override val base1: Int = 0 override val base2: Int = 0 - [platformStatic] get + @platformStatic get } object A : B() { var p:Int = 1 - [platformStatic] set(p1: Int) { + @platformStatic set(p1: Int) { p = 1 } - [platformStatic] val z = 1; + @platformStatic val z = 1; - [platformStatic] override val base1: Int = 0 + @platformStatic override val base1: Int = 0 platformStatic open fun f() {} override val base2: Int = 0 - [platformStatic] get + @platformStatic get } var p:Int = 1 - [platformStatic] set(p1: Int) { + @platformStatic set(p1: Int) { p = 1 } - [platformStatic] val z2 = 1; + @platformStatic val z2 = 1; } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmOverloads.kt b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmOverloads.kt index a55f377bb47..6c4c47bcabe 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmOverloads.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmOverloads.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER class A { - [kotlin.jvm.overloads] fun foo(s: String = "") { + @kotlin.jvm.overloads fun foo(s: String = "") { } fun foo() { diff --git a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformNames.kt b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformNames.kt index 34766d2379b..848c7aa77a9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformNames.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformNames.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.platform.* -[platformName("bar")] +@platformName("bar") fun foo(a: Any) {} fun Any.foo() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformNamesDuplicate.kt b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformNamesDuplicate.kt index b77fd476579..01fc75b9418 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformNamesDuplicate.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/platformNamesDuplicate.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.platform.* -[platformName("bar")] +@platformName("bar") fun foo(a: Any) {} fun bar(a: Any) {} \ No newline at end of file diff --git a/idea/testData/checker/custom/noUnusedParameterWhenCustom.kt b/idea/testData/checker/custom/noUnusedParameterWhenCustom.kt index 39555d10041..108080b56c5 100644 --- a/idea/testData/checker/custom/noUnusedParameterWhenCustom.kt +++ b/idea/testData/checker/custom/noUnusedParameterWhenCustom.kt @@ -4,7 +4,7 @@ fun unused(pbar(block: () -> @private fun foo() { - 1 + [Ann] 2 + 1 + @Ann 2 @Ann 3 + 4 diff --git a/idea/testData/highlighter/TypesAndAnnotations.kt b/idea/testData/highlighter/TypesAndAnnotations.kt index 4f988fcf4c8..75f627c25ac 100644 --- a/idea/testData/highlighter/TypesAndAnnotations.kt +++ b/idea/testData/highlighter/TypesAndAnnotations.kt @@ -7,6 +7,6 @@ class TheClass : annotation class magnificent annotation class deprecated -[deprecated] +@deprecated magnificent abstract class AbstractClass<T> { } diff --git a/idea/testData/highlighter/deprecated/Getter.kt b/idea/testData/highlighter/deprecated/Getter.kt index bd57a80852e..2a5e4f03c05 100644 --- a/idea/testData/highlighter/deprecated/Getter.kt +++ b/idea/testData/highlighter/deprecated/Getter.kt @@ -9,13 +9,13 @@ fun test() { class MyClass() { public val test1: String = "" - [deprecated("Use A instead")] get + @deprecated("Use A instead") get public var test2: String = "" - [deprecated("Use A instead")] get + @deprecated("Use A instead") get deprecated("Use A instead") public val test3: String = "" - [deprecated("Use A instead")] get + @deprecated("Use A instead") get } // NO_CHECK_INFOS diff --git a/idea/testData/highlighter/deprecated/Setter.kt b/idea/testData/highlighter/deprecated/Setter.kt index f1d2b2d68b0..04f86cb9be9 100644 --- a/idea/testData/highlighter/deprecated/Setter.kt +++ b/idea/testData/highlighter/deprecated/Setter.kt @@ -19,11 +19,11 @@ fun test() { class MyClass() { public var test1: Int = 0 - [deprecated("Use A instead")] set + @deprecated("Use A instead") set } public var test2: Int = 0 - [deprecated("Use A instead")] set + @deprecated("Use A instead") set // NO_CHECK_INFOS // NO_CHECK_WEAK_WARNINGS \ No newline at end of file diff --git a/idea/testData/quickfix/createFromUsage/createFunction/call/beforeCallInAnnotationEntry.kt b/idea/testData/quickfix/createFromUsage/createFunction/call/beforeCallInAnnotationEntry.kt index 3ccb7cd63d7..bc0d4f181c9 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/call/beforeCallInAnnotationEntry.kt +++ b/idea/testData/quickfix/createFromUsage/createFunction/call/beforeCallInAnnotationEntry.kt @@ -3,6 +3,6 @@ // ERROR: Unresolved reference: foo // ERROR: Unresolved reference: bar -[foo(1, "2", bar("3", 4))] fun test() { +@foo(1, "2", bar("3", 4)) fun test() { } \ No newline at end of file diff --git a/idea/testData/quickfix/suppress/forStatement/unavailable/beforeInAnnotationArgument.kt b/idea/testData/quickfix/suppress/forStatement/unavailable/beforeInAnnotationArgument.kt index a0732e4539e..0fd089bd058 100644 --- a/idea/testData/quickfix/suppress/forStatement/unavailable/beforeInAnnotationArgument.kt +++ b/idea/testData/quickfix/suppress/forStatement/unavailable/beforeInAnnotationArgument.kt @@ -1,7 +1,7 @@ // "class com.intellij.codeInspection.SuppressIntentionAction" "false" // ACTION: Suppress 'INTEGER_OVERFLOW' for fun foo -[Ann(Integer.MAX_VALUE + 1)] +@Ann(Integer.MAX_VALUE + 1) fun foo() {} annotation class Ann(val b: Int) \ No newline at end of file