diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index 2d90edf8445..1e7adabe012 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -1254,7 +1254,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER}) kotlin. /*primary*/ public constructor data() } -kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.FIELD, AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.annotation(mustBeDocumented = true) public final class deprecated : kotlin.Annotation { +kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.annotation(mustBeDocumented = true) public final class deprecated : kotlin.Annotation { /*primary*/ public constructor deprecated(/*0*/ value: kotlin.String, /*1*/ replaceWith: kotlin.ReplaceWith = ...) internal final val replaceWith: kotlin.ReplaceWith internal final fun (): kotlin.ReplaceWith diff --git a/compiler/testData/codegen/boxWithStdlib/reflection/annotations/simpleValAnnotation.kt b/compiler/testData/codegen/boxWithStdlib/reflection/annotations/simpleValAnnotation.kt index 329a0eabc40..4f5f416817b 100644 --- a/compiler/testData/codegen/boxWithStdlib/reflection/annotations/simpleValAnnotation.kt +++ b/compiler/testData/codegen/boxWithStdlib/reflection/annotations/simpleValAnnotation.kt @@ -1,6 +1,6 @@ annotation(retention = AnnotationRetention.RUNTIME) class Simple(val value: String) -@Simple("OK") +@property:Simple("OK") val foo: Int = 0 fun box(): String { diff --git a/compiler/testData/compileJavaAgainstKotlin/class/kt4050.kt b/compiler/testData/compileJavaAgainstKotlin/class/kt4050.kt index 55838275751..f533b05502c 100644 --- a/compiler/testData/compileJavaAgainstKotlin/class/kt4050.kt +++ b/compiler/testData/compileJavaAgainstKotlin/class/kt4050.kt @@ -1,6 +1,6 @@ package test -enum class MyEnum(deprecated("") val ord: Int) { +enum class MyEnum(@param:deprecated("") @property:deprecated("") val ord: Int) { ENTRY(239); fun f(Deprecated p: Int) { diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt index 462df314f9c..ffe2cd297fb 100644 --- a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleClassObjectProperty.txt @@ -7,7 +7,7 @@ internal final class A { public companion object Companion { private constructor Companion() - kotlin.platform.platformStatic() internal final val b: kotlin.String + @field:kotlin.platform.platformStatic() internal final val b: kotlin.String internal final var test.A.c: kotlin.String } } diff --git a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt index 0f8aa9229f0..1b6885a3e09 100644 --- a/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt +++ b/compiler/testData/compileJavaAgainstKotlin/platformStatic/simpleObjectProperty.txt @@ -4,7 +4,7 @@ internal fun main(/*0*/ kotlin.Array): kotlin.Unit internal object A { private constructor A() - kotlin.platform.platformStatic() internal final val b: kotlin.String + @field:kotlin.platform.platformStatic() internal final val b: kotlin.String internal final var test.A.c: kotlin.String } diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.txt b/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.txt index 496574921bd..8971708eb5b 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.txt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.txt @@ -2,7 +2,7 @@ package internal final class Annotated { public constructor Annotated(/*0*/ ann() x: kotlin.Int) - ann() internal final val x: kotlin.Int + internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructorParams.txt b/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructorParams.txt index dfceac0b263..078948a73ce 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructorParams.txt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructorParams.txt @@ -6,8 +6,8 @@ package a { internal final class Test { public constructor Test(/*0*/ java.lang.Deprecated() s: kotlin.String, /*1*/ java.lang.SuppressWarnings(value = {}) x: kotlin.Int) - java.lang.Deprecated() internal final val s: kotlin.String - java.lang.SuppressWarnings(value = {}) internal final val x: kotlin.Int + internal final val s: kotlin.String + internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.txt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.txt index 39cd83556cd..e93eb2622af 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.txt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.txt @@ -2,7 +2,7 @@ package kotlin.annotation.annotation() internal final class RecursivelyAnnotated : kotlin.Annotation { public constructor RecursivelyAnnotated(/*0*/ RecursivelyAnnotated(x = 1) x: kotlin.Int) - RecursivelyAnnotated(x = 1) internal final val x: kotlin.Int + internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.txt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.txt index 39cd83556cd..e93eb2622af 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.txt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.txt @@ -2,7 +2,7 @@ package kotlin.annotation.annotation() internal final class RecursivelyAnnotated : kotlin.Annotation { public constructor RecursivelyAnnotated(/*0*/ RecursivelyAnnotated(x = 1) x: kotlin.Int) - RecursivelyAnnotated(x = 1) internal final val x: kotlin.Int + internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.txt b/compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.txt index 2bc4d2a30c0..cfbec6045a7 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.txt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyIncorrectlyAnnotatedParameter.txt @@ -2,7 +2,7 @@ package internal final class RecursivelyAnnotated { public constructor RecursivelyAnnotated(/*0*/ RecursivelyAnnotated(x = 1) x: kotlin.Int) - RecursivelyAnnotated(x = 1) internal final val x: kotlin.Int + internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/accessors.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/accessors.kt index a5f5fd27205..eaa94700d74 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 @@ target(AnnotationTarget.FUNCTION) annotation class base class My(x: Int) { - smartget var y = x - @base @smartget @smartset get - @base @smartget @smartset set + smartget var y = x + @base @smartget @smartset get + @base @smartget @smartset set base smartget smartset fun foo() = y } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/accessors.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/accessors.txt index 641527b226c..176a08cc51e 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/accessors.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/accessors.txt @@ -2,7 +2,7 @@ package internal final class My { public constructor My(/*0*/ x: kotlin.Int) - smartget() internal final var y: kotlin.Int + internal final var y: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean base() smartget() smartset() internal final fun foo(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/annotation.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/annotation.txt index c8c94745fff..698f2c0f8f6 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/annotation.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/annotation.txt @@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.ANNOTATION_CLASS}) k base() internal final class correct { base() public constructor correct() - public constructor correct(/*0*/ base() x: kotlin.Int) + public constructor correct(/*0*/ x: kotlin.Int) base() internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/classifier.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/classifier.txt index eeb65e14ddc..cdcad7775ce 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/classifier.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/classifier.txt @@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER}) kotlin. base() internal final class correct { base() public constructor correct() - public constructor correct(/*0*/ base() x: kotlin.Int, /*1*/ base() w: @[base()] kotlin.Int) + public constructor correct(/*0*/ x: kotlin.Int, /*1*/ base() w: @[base()] kotlin.Int) base() internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/constructor.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/constructor.txt index 885614bcc36..e486ebdc249 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/constructor.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/constructor.txt @@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.CONSTRUCTOR}) kotlin base() internal final class correct { base() public constructor correct() - public constructor correct(/*0*/ base() x: kotlin.Int) + public constructor correct(/*0*/ x: kotlin.Int) base() internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/empty.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/empty.txt index fd624e15c1c..ee6f1eca761 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/empty.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/empty.txt @@ -24,7 +24,7 @@ empty() internal final enum class My : kotlin.Enum { empty() internal final class correct { empty() public constructor correct() - public constructor correct(/*0*/ empty() x: kotlin.Int, /*1*/ empty() w: @[empty()] kotlin.Int) + public constructor correct(/*0*/ x: kotlin.Int, /*1*/ empty() w: @[empty()] kotlin.Int) empty() internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/file.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/file.kt index 76072bdaf90..cb6d93d4bf2 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/file.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/file.kt @@ -8,7 +8,7 @@ annotation class common // FILE: other.kt -@file:special +@file:special package test @@ -16,8 +16,8 @@ package test // FILE: another.kt -@file:common +@file:common package test -common class Correct +common class Correct \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/function.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/function.txt index fc201e2cfe7..33db50a321a 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/function.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/function.txt @@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION}) kotlin.an base() internal final class correct { base() public constructor correct() - public constructor correct(/*0*/ base() x: kotlin.Int) + public constructor correct(/*0*/ x: kotlin.Int) base() internal final val x: kotlin.Int base() public final fun baz(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/incorrect.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/incorrect.txt index 1e7cee2a629..009f53add6e 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/incorrect.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/incorrect.txt @@ -24,7 +24,7 @@ incorrect() internal final enum class My : kotlin.Enum { incorrect() internal final class correct { incorrect() public constructor correct() - public constructor correct(/*0*/ incorrect() x: kotlin.Int, /*1*/ incorrect() w: @[incorrect()] kotlin.Int) + public constructor correct(/*0*/ x: kotlin.Int, /*1*/ incorrect() w: @[incorrect()] kotlin.Int) incorrect() internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/java.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/java.kt index 2de8bfd70d1..41081380c0d 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/java.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/java.kt @@ -21,7 +21,7 @@ public class AnnotationTargets { } @Target(ElementType.FIELD) - public @interface field { + public @interface fieldann { } @@ -62,18 +62,18 @@ import test.AnnotationTargets.* base meta type konstructor annotation class KMeta base meta type method multiple class KClass( - @base @field @parameter val y: - @base @type Int) { + @base @fieldann @parameter val y: + @base @type Int) { + + base multiple fieldann local val x = 0 + @method @konstructor @type get - base multiple field local val x = 0 - @method @konstructor @type get - base method multiple konstructor fun foo(@parameter @type i: - @base @multiple Int - ): @field @parameter Int { + @base @multiple Int + ): @fieldann @parameter Int { - @local @base @multiple @field val j = i + 1 + @local @base @multiple @fieldann val j = i + 1 @base @multiple return j } diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/java.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/java.txt index 351330d6ace..2ecbd1c3655 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/java.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/java.txt @@ -15,8 +15,8 @@ package test { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - kotlin.annotation.target(allowedTargets = {AnnotationTarget.FIELD}) public final class field : kotlin.Annotation { - public constructor field() + kotlin.annotation.target(allowedTargets = {AnnotationTarget.FIELD}) public final class fieldann : kotlin.Annotation { + public constructor fieldann() 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 @@ -74,11 +74,11 @@ package test { test.AnnotationTargets.base() test.AnnotationTargets.meta() test.AnnotationTargets.type() test.AnnotationTargets.method() test.AnnotationTargets.multiple() internal final class KClass { test.AnnotationTargets.base() test.AnnotationTargets.method() test.AnnotationTargets.konstructor() public constructor KClass() - public constructor KClass(/*0*/ test.AnnotationTargets.base() test.AnnotationTargets.field() test.AnnotationTargets.parameter() y: @[test.AnnotationTargets.base() test.AnnotationTargets.type()] kotlin.Int) - test.AnnotationTargets.base() test.AnnotationTargets.multiple() test.AnnotationTargets.field() test.AnnotationTargets.local() internal final val x: kotlin.Int = 0 - test.AnnotationTargets.base() test.AnnotationTargets.field() test.AnnotationTargets.parameter() internal final val y: @[test.AnnotationTargets.base() test.AnnotationTargets.type()] kotlin.Int + public constructor KClass(/*0*/ test.AnnotationTargets.base() test.AnnotationTargets.parameter() y: @[test.AnnotationTargets.base() test.AnnotationTargets.type()] kotlin.Int) + test.AnnotationTargets.base() test.AnnotationTargets.multiple() test.AnnotationTargets.fieldann() test.AnnotationTargets.local() internal final val x: kotlin.Int = 0 + test.AnnotationTargets.fieldann() internal final val y: @[test.AnnotationTargets.base() test.AnnotationTargets.type()] kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - test.AnnotationTargets.base() test.AnnotationTargets.method() test.AnnotationTargets.multiple() test.AnnotationTargets.konstructor() internal final fun foo(/*0*/ test.AnnotationTargets.parameter() test.AnnotationTargets.type() i: @[test.AnnotationTargets.base() test.AnnotationTargets.multiple()] kotlin.Int): @[test.AnnotationTargets.field() test.AnnotationTargets.parameter()] kotlin.Int + test.AnnotationTargets.base() test.AnnotationTargets.method() test.AnnotationTargets.multiple() test.AnnotationTargets.konstructor() internal final fun foo(/*0*/ test.AnnotationTargets.parameter() test.AnnotationTargets.type() i: @[test.AnnotationTargets.base() test.AnnotationTargets.multiple()] kotlin.Int): @[test.AnnotationTargets.fieldann() test.AnnotationTargets.parameter()] kotlin.Int 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/targets/local.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/local.txt index bcb8f3a4dff..f20dd6c4b0d 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/local.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/local.txt @@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.LOCAL_VARIABLE}) kot base() internal final class correct { base() public constructor correct() - public constructor correct(/*0*/ base() x: kotlin.Int) + public constructor correct(/*0*/ x: kotlin.Int) base() internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/property.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/property.txt index 73099ff7b7b..01bac8411b7 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/property.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/property.txt @@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.PROPERTY}) kotlin.an base() internal final class correct { base() public constructor correct() - public constructor correct(/*0*/ base() x: kotlin.Int, /*1*/ base() w: kotlin.Int) + public constructor correct(/*0*/ x: kotlin.Int, /*1*/ base() w: kotlin.Int) base() internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/type.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/type.txt index 37123dc6334..04e93a0e9e8 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/type.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/type.txt @@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.TYPE}) kotlin.annota base() internal final class correct { base() public constructor correct() - public constructor correct(/*0*/ base() x: @[base()] kotlin.Int) + public constructor correct(/*0*/ x: @[base()] kotlin.Int) base() internal final val x: @[base()] 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 diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.kt index 226f95273e6..4a9b95b1a88 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.kt @@ -3,7 +3,7 @@ target(AnnotationTarget.VALUE_PARAMETER) annotation class base base annotation class derived -base class correct(base val x: Int, base w: Int) { +base class correct(base val x: Int, base w: Int) { base constructor(): this(0, 0) } diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.txt b/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.txt index 5f8cc1c401e..15359a0dac5 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/valueparam.txt @@ -32,7 +32,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) ko base() internal final class correct { base() public constructor correct() public constructor correct(/*0*/ base() x: kotlin.Int, /*1*/ base() w: kotlin.Int) - base() internal final val x: kotlin.Int + internal final val x: 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 diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.kt index af32874b86f..e7d3f63959e 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.kt @@ -4,10 +4,10 @@ class CustomDelegate { public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name } -@field:Ann +@field:Ann class SomeClass { - @field:Ann + @field:Ann constructor() @field:Ann @@ -23,12 +23,12 @@ class SomeClass { val propertyWithCustomGetter: Int get() = 5 - @field:Ann - fun anotherFun(@field:Ann s: String) { - @field:Ann + @field:Ann + fun anotherFun(@field:Ann s: String) { + @field:Ann val localVariable = 5 } } -class WithPrimaryConstructor(@field:Ann val a: String) \ No newline at end of file +class WithPrimaryConstructor(@field:Ann val a: String) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.txt index b339893b3aa..a6e74d902d7 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.txt @@ -28,7 +28,7 @@ internal final class CustomDelegate { } internal final class WithPrimaryConstructor { - public constructor WithPrimaryConstructor(/*0*/ @field:Ann() a: kotlin.String) + public constructor WithPrimaryConstructor(/*0*/ a: kotlin.String) @field:Ann() internal final val a: kotlin.String public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt index 3ac40262630..bb788277ac5 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt @@ -4,10 +4,10 @@ class CustomDelegate { public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name } -@get:Ann +@get:Ann class SomeClass { - @get:Ann + @get:Ann constructor() @get:Ann @@ -26,11 +26,11 @@ class SomeClass { val propertyWithCustomGetter: Int get() = 5 - @get:Ann + @get:Ann fun annotationOnFunction(a: Int) = a + 5 fun anotherFun() { - @get:Ann + @get:Ann val localVariable = 5 } diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.txt index c0377496d5a..2546d58e65b 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.txt @@ -17,11 +17,11 @@ internal final class CustomDelegate { @get:Ann() internal final class SomeClass { @get:Ann() public constructor SomeClass() - @get:Ann() protected final val delegatedProperty: kotlin.String - @get:Ann() protected final var mutableProperty: kotlin.String - @get:Ann() internal final val propertyWithCustomGetter: kotlin.Int - @get:Ann() protected final val simpleProperty: kotlin.String = "text" - @get:Ann() protected final val simplePropertyWithAnnotationList: kotlin.String = "text" + protected final val delegatedProperty: kotlin.String + protected final var mutableProperty: kotlin.String + internal final val propertyWithCustomGetter: kotlin.Int + protected final val simpleProperty: kotlin.String = "text" + protected final val simplePropertyWithAnnotationList: kotlin.String = "text" @get:Ann() internal final fun annotationOnFunction(/*0*/ a: kotlin.Int): kotlin.Int internal final fun anotherFun(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ParamAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ParamAnnotations.kt index 2443dcc67af..be3a2eced72 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ParamAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ParamAnnotations.kt @@ -1,24 +1,24 @@ annotation class Ann annotation class Second -@param:Ann +@param:Ann class SomeClass { - @param:Ann - constructor(@param:Ann a: String) + @param:Ann + constructor(@param:Ann a: String) - @param:Ann + @param:Ann protected val simpleProperty: String = "text" - @param:Ann + @param:Ann fun anotherFun() { - @param:Ann + @param:Ann val localVariable = 5 } } class PrimaryConstructorClass( - @param:Ann a: String, - @param:[Ann Second] b: String, - @param:Ann val c: String) \ No newline at end of file + @param:Ann a: String, +@param:[Ann Second] b: String, +@param:Ann val c: String) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ParamAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ParamAnnotations.txt index b210a47b426..95782a137eb 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ParamAnnotations.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ParamAnnotations.txt @@ -8,7 +8,8 @@ kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation { } internal final class PrimaryConstructorClass { - public constructor PrimaryConstructorClass(/*0*/ @param:Ann() a: kotlin.String, /*1*/ @param:Ann() @param:Second() b: kotlin.String) + public constructor PrimaryConstructorClass(/*0*/ @param:Ann() a: kotlin.String, /*1*/ @param:Ann() @param:Second() b: kotlin.String, /*2*/ @param:Ann() c: kotlin.String) + internal final val c: kotlin.String public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt index 5d7afeb6895..0192ce2215a 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt @@ -5,10 +5,10 @@ class CustomDelegate { public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name } -@property:Ann +@property:Ann class SomeClass { - @property:Ann + @property:Ann constructor(s: String) @property:Ann @@ -28,9 +28,9 @@ class SomeClass { get() = 5 set(v) {} - @property:Ann + @property:Ann fun anotherFun() { - @property:Ann + @property:Ann val localVariable = 5 } diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ReceiverAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ReceiverAnnotations.kt index 13af8259ce2..6c8e2c23e34 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ReceiverAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ReceiverAnnotations.kt @@ -1,9 +1,9 @@ annotation class Ann -@receiver:Ann +@receiver:Ann class SomeClass { - @receiver:Ann + @receiver:Ann constructor(@receiver:Ann a: String) @receiver:Ann @@ -15,14 +15,11 @@ class SomeClass { val localVariable = 5 } - @receiver:Ann - val String.extensionProperty2: String + val @receiver:Ann String.extensionProperty2: String get() = "A" } -@receiver:Ann -fun String.length2() = length() +fun @receiver:Ann String.length2() = length() -@receiver:Ann -val String.extensionProperty: String +val @receiver:Ann String.extensionProperty: String get() = "A" \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ReceiverAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ReceiverAnnotations.txt index 578410daf86..7f4acd7cbbf 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ReceiverAnnotations.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/ReceiverAnnotations.txt @@ -1,7 +1,7 @@ package -@receiver:Ann() internal val kotlin.String.extensionProperty: kotlin.String -@receiver:Ann() internal fun kotlin.String.length2(): kotlin.Int +internal val @receiver:Ann() kotlin.String.extensionProperty: kotlin.String +internal fun @receiver:Ann() kotlin.String.length2(): kotlin.Int kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation { public constructor Ann() @@ -13,6 +13,7 @@ kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation { @receiver:Ann() internal final class SomeClass { @receiver:Ann() public constructor SomeClass(/*0*/ @receiver:Ann() a: kotlin.String) @receiver:Ann() protected final val simpleProperty: kotlin.String = "text" + internal final val @receiver:Ann() kotlin.String.extensionProperty2: kotlin.String @receiver:Ann() internal final fun anotherFun(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.kt index 7ae04a32220..637f82e7a88 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.kt @@ -5,7 +5,7 @@ class CustomDelegate { fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {} } -@set:Ann +@set:Ann class SomeClass { @set:Ann @@ -25,11 +25,11 @@ class SomeClass { get() = 5 set(v) {} - @set:Ann + @set:Ann fun annotationOnFunction(a: Int) = a + 5 fun anotherFun() { - @set:Ann + @set:Ann val localVariable = 5 } diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.txt index a53e78b36f8..4178a517ffe 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.txt @@ -18,10 +18,10 @@ internal final class CustomDelegate { @set:Ann() internal final class SomeClass { public constructor SomeClass() - @set:Ann() protected final var delegatedProperty: kotlin.String - @set:Ann() protected final var mutableProperty: kotlin.String - @set:Ann() protected final var mutablePropertyWithAnnotationList: kotlin.String - @set:Ann() internal final var propertyWithCustomSetter: kotlin.Int + protected final var delegatedProperty: kotlin.String + protected final var mutableProperty: kotlin.String + protected final var mutablePropertyWithAnnotationList: kotlin.String + internal final var propertyWithCustomSetter: kotlin.Int @set:Ann() protected final val simpleProperty: kotlin.String = "text" @set:Ann() internal final fun annotationOnFunction(/*0*/ a: kotlin.Int): kotlin.Int internal final fun anotherFun(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt index ab16138238e..c2779afd51a 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt @@ -5,10 +5,10 @@ class CustomDelegate { fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {} } -@sparam:Ann +@sparam:Ann class SomeClass { - @sparam:Ann + @sparam:Ann constructor() @sparam:Ann @@ -28,9 +28,9 @@ class SomeClass { get() = 5 set(v) {} - @sparam:Ann + @sparam:Ann fun anotherFun() { - @sparam:Ann + @sparam:Ann val localVariable = 5 } diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/repeatable.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/repeatable.kt index 9305c2614c0..091e3ab315b 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/repeatable.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/repeatable.kt @@ -1,4 +1,4 @@ -annotation(repeatable = true) class RepeatableAnn +annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class RepeatableAnn annotation class Ann public class A(@param:Ann @Ann val x: Int, @param: RepeatableAnn @Ann val y: Int) { diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/repeatable.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/repeatable.txt index fedcce0db14..c77b6b63d06 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/repeatable.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/repeatable.txt @@ -1,11 +1,11 @@ package public final class A { - public constructor A(/*0*/ Ann() Ann() x: kotlin.Int, /*1*/ RepeatableAnn() Ann() y: kotlin.Int) - Ann() RepeatableAnn() Ann() RepeatableAnn() internal final val a: kotlin.Int = 0 - Ann() Ann() Ann() internal final val b: kotlin.Int = 0 - RepeatableAnn() RepeatableAnn() internal final val c: kotlin.Int = 0 - RepeatableAnn() RepeatableAnn() internal final val d: kotlin.Int = 0 + public constructor A(/*0*/ @param:Ann() Ann() x: kotlin.Int, /*1*/ @param:RepeatableAnn() Ann() y: kotlin.Int) + @property:Ann() @property:RepeatableAnn() @field:Ann() RepeatableAnn() internal final val a: kotlin.Int = 0 + @property:Ann() Ann() @field:Ann() internal final val b: kotlin.Int = 0 + @field:RepeatableAnn() @field:RepeatableAnn() internal final val c: kotlin.Int = 0 + @property:RepeatableAnn() RepeatableAnn() internal final val d: kotlin.Int = 0 internal final val x: kotlin.Int internal final val y: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean @@ -20,7 +20,7 @@ kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -kotlin.annotation.annotation(repeatable = true) internal final class RepeatableAnn : kotlin.Annotation { +kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class RepeatableAnn : kotlin.Annotation { public constructor RepeatableAnn() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.kt b/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.kt index 4451972d529..d66724bf5d7 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.kt @@ -1,3 +1,4 @@ +target(AnnotationTarget.TYPE, AnnotationTarget.FUNCTION) annotation class a interface A interface B diff --git a/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.txt b/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.txt index bb83655f05b..b5b0b635cc4 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/FunctionWithMissingNames.txt @@ -29,7 +29,7 @@ internal final class Outer { internal final fun B.(): kotlin.Unit } -kotlin.annotation.annotation() internal final class a : kotlin.Annotation { +kotlin.annotation.target(allowedTargets = {AnnotationTarget.TYPE, AnnotationTarget.FUNCTION}) kotlin.annotation.annotation() internal final class a : kotlin.Annotation { public constructor a() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/deprecated/javaDeprecated.txt b/compiler/testData/diagnostics/tests/deprecated/javaDeprecated.txt index ab8bd7bf115..b6acd895845 100644 --- a/compiler/testData/diagnostics/tests/deprecated/javaDeprecated.txt +++ b/compiler/testData/diagnostics/tests/deprecated/javaDeprecated.txt @@ -10,7 +10,7 @@ kotlin.deprecated(value = "Deprecated in Java") public open class A { internal final class B : A { public constructor B(/*0*/ foo: kotlin.String) - kotlin.deprecated() private final val foo: kotlin.String + @property:kotlin.deprecated() private final val foo: kotlin.String public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ fun getFoo(/*0*/ text: kotlin.String): kotlin.String public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/deprecated/propertyUseSiteTargetedAnnotations.kt b/compiler/testData/diagnostics/tests/deprecated/propertyUseSiteTargetedAnnotations.kt new file mode 100644 index 00000000000..e883ac8e67f --- /dev/null +++ b/compiler/testData/diagnostics/tests/deprecated/propertyUseSiteTargetedAnnotations.kt @@ -0,0 +1,31 @@ +// !DIAGNOSTICS: -UNUSED_EXPRESSION + +class PropertyHolder { + deprecated("") + val a1 = 1 + + @property:deprecated("") + var a2 = "" + + @get:deprecated("") + public val withGetter: String = "" + + @set:deprecated("") + public var withSetter: String = "" +} + +fun fn() { + val holder = PropertyHolder() + + holder.a1 + holder.a2 + holder.withGetter + holder.withSetter = "A" +} + +fun literals() { + PropertyHolder::a1 + PropertyHolder::a2 + PropertyHolder::withGetter + PropertyHolder::withSetter +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deprecated/propertyUseSiteTargetedAnnotations.txt b/compiler/testData/diagnostics/tests/deprecated/propertyUseSiteTargetedAnnotations.txt new file mode 100644 index 00000000000..6c0d7282bb1 --- /dev/null +++ b/compiler/testData/diagnostics/tests/deprecated/propertyUseSiteTargetedAnnotations.txt @@ -0,0 +1,15 @@ +package + +internal fun fn(): kotlin.Unit +internal fun literals(): kotlin.Unit + +internal final class PropertyHolder { + public constructor PropertyHolder() + kotlin.deprecated(value = "") internal final val a1: kotlin.Int = 1 + @property:kotlin.deprecated(value = "") internal final var a2: kotlin.String + public final val withGetter: kotlin.String = "" + public final var withSetter: kotlin.String + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.txt b/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.txt index c0302f33667..cb9e3580083 100644 --- a/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.txt +++ b/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.txt @@ -126,7 +126,7 @@ package illegal_modifiers { internal final class LegalModifier { public constructor LegalModifier(/*0*/ a: kotlin.Int, /*1*/ illegal_modifiers.annotated() b: kotlin.String, /*2*/ illegal_modifiers.annotated() vararg v: kotlin.Int /*kotlin.IntArray*/) internal final val a: kotlin.Int - illegal_modifiers.annotated() private final var b: kotlin.String + private final var b: kotlin.String public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/overload/ConflictingOverloadsIdenticalValsInClass.kt b/compiler/testData/diagnostics/tests/overload/ConflictingOverloadsIdenticalValsInClass.kt index cd4d6ad3fbb..1aec18caa64 100644 --- a/compiler/testData/diagnostics/tests/overload/ConflictingOverloadsIdenticalValsInClass.kt +++ b/compiler/testData/diagnostics/tests/overload/ConflictingOverloadsIdenticalValsInClass.kt @@ -1,4 +1,4 @@ class Aaa() { val a = 1 val a = 1 -} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/overload/ConflictingOverloadsValsDifferentTypeInClass.kt b/compiler/testData/diagnostics/tests/overload/ConflictingOverloadsValsDifferentTypeInClass.kt index e1abf31236f..44872ce40b8 100644 --- a/compiler/testData/diagnostics/tests/overload/ConflictingOverloadsValsDifferentTypeInClass.kt +++ b/compiler/testData/diagnostics/tests/overload/ConflictingOverloadsValsDifferentTypeInClass.kt @@ -1,4 +1,4 @@ class Aaa() { val a = 1 val a = "" -} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.kt index 138b9a97d89..d291c892735 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.kt @@ -6,10 +6,10 @@ fun foo() {} @jvmName("b") fun Any.foo() {} -@jvmName("c") +@jvmName("c") val px = 1 -@jvmName("d") +@jvmName("d") val Any.px : Int get() = 1 @@ -39,22 +39,22 @@ class C jvmName("primary") constructor() { @jvmName("b") fun Any.foo() {} - @jvmName("c") + @jvmName("c") val px = 1 - @jvmName("d") + @jvmName("d") val Any.px : Int - get() = 1 + get() = 1 val valx: Int - @jvmName("e") - get() = 1 + @jvmName("e") + get() = 1 var varx: Int - @jvmName("f") - get() = 1 - @jvmName("g") - set(v) {} + @jvmName("f") + get() = 1 + @jvmName("g") + set(v) {} } fun foo1() { @@ -86,4 +86,4 @@ class D: AB() { @jvmName("D_finalFun") fun finalFun() {} -} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.txt index 4cfe0726429..573019eef05 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/jvmName.txt @@ -1,10 +1,10 @@ package -kotlin.jvm.jvmName(name = "c") internal val px: kotlin.Int = 1 +internal val px: kotlin.Int = 1 internal val valx: kotlin.Int internal var vardef: kotlin.Int internal var varx: kotlin.Int -kotlin.jvm.jvmName(name = "d") internal val kotlin.Any.px: kotlin.Int +internal val kotlin.Any.px: kotlin.Int kotlin.jvm.jvmName(name = "a") internal fun foo(): kotlin.Unit internal fun foo1(): kotlin.Unit kotlin.jvm.jvmName(name = "b") internal fun kotlin.Any.foo(): kotlin.Unit @@ -22,10 +22,10 @@ internal abstract class AB { kotlin.jvm.jvmName(name = "C") internal final class C { kotlin.jvm.jvmName(name = "primary") public constructor C() kotlin.jvm.jvmName(name = "ctr") public constructor C(/*0*/ x: kotlin.Int) - kotlin.jvm.jvmName(name = "c") internal final val px: kotlin.Int = 1 + internal final val px: kotlin.Int = 1 internal final val valx: kotlin.Int internal final var varx: kotlin.Int - kotlin.jvm.jvmName(name = "d") internal final val kotlin.Any.px: kotlin.Int + internal final val kotlin.Any.px: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean kotlin.jvm.jvmName(name = "a") internal final fun foo(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/ClassObjectPropertyField.kt b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/ClassObjectPropertyField.kt index 2fd4f6beab7..45b800c8ef4 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/ClassObjectPropertyField.kt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/ClassObjectPropertyField.kt @@ -4,6 +4,6 @@ annotation class Anno class Class { companion object { - @[Anno] var property: Int = 42 + @field:Anno var property: Int = 42 } } diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/ClassObjectPropertyField.txt b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/ClassObjectPropertyField.txt index 4ad780aedfb..584babbd736 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/ClassObjectPropertyField.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/ClassObjectPropertyField.txt @@ -9,7 +9,7 @@ internal final class Class { public companion object Companion { /*primary*/ private constructor Companion() - test.Anno() internal final var property: kotlin.Int + @field:test.Anno() internal final var property: kotlin.Int internal final fun (): kotlin.Int internal final fun (/*0*/ : kotlin.Int): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/EnumArgument.kt b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/EnumArgument.kt index 4726039d85a..3c61d660dc6 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/EnumArgument.kt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/EnumArgument.kt @@ -8,5 +8,5 @@ annotation class Anno(val t: ElementType) class Class { Anno(ElementType.METHOD) fun foo() {} - Anno(ElementType.FIELD) var bar = 42 + @field:Anno(ElementType.FIELD) var bar = 42 } diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/EnumArgument.txt b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/EnumArgument.txt index 42e31ecfc79..103f499281c 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/EnumArgument.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/EnumArgument.txt @@ -8,7 +8,7 @@ kotlin.annotation.annotation() internal final class Anno : kotlin.Annotation { internal final class Class { /*primary*/ public constructor Class() - test.Anno(t = ElementType.FIELD) internal final var bar: kotlin.Int + @field:test.Anno(t = ElementType.FIELD) internal final var bar: kotlin.Int internal final fun (): kotlin.Int internal final fun (/*0*/ : kotlin.Int): kotlin.Unit test.Anno(t = ElementType.METHOD) internal final fun foo(): kotlin.Unit diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.kt b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.kt index cdf05c2a932..85be48f9106 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.kt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.kt @@ -3,5 +3,5 @@ package test annotation class Anno class Class { - @[Anno] var property: Int = 42 + @field:Anno var property: Int = 42 } diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.txt b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.txt index 44c27f1ce64..fd6b40dbb4d 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.txt @@ -6,7 +6,7 @@ kotlin.annotation.annotation() internal final class Anno : kotlin.Annotation { internal final class Class { /*primary*/ public constructor Class() - test.Anno() internal final var property: kotlin.Int + @field:test.Anno() internal final var property: kotlin.Int internal final fun (): kotlin.Int internal final fun (/*0*/ : kotlin.Int): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArgument.kt b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArgument.kt index c98e12002e9..f6bb748fe5b 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArgument.kt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArgument.kt @@ -7,4 +7,4 @@ annotation class Anno(val t: ElementType) Anno(ElementType.METHOD) fun foo() {} -Anno(ElementType.FIELD) val bar = 42 +@field:Anno(ElementType.FIELD) val bar = 42 diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArgument.txt b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArgument.txt index 9d851d40c4e..cdd8d66abb7 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArgument.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArgument.txt @@ -1,6 +1,6 @@ package test -test.Anno(t = ElementType.FIELD) internal val bar: kotlin.Int = 42 +@field:test.Anno(t = ElementType.FIELD) internal val bar: kotlin.Int = 42 internal fun (): kotlin.Int test.Anno(t = ElementType.METHOD) internal fun foo(): kotlin.Unit diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArrayArgument.kt b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArrayArgument.kt index 5ecb954db5d..e6cc362b058 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArrayArgument.kt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArrayArgument.kt @@ -7,6 +7,6 @@ annotation class Anno(vararg val t: ElementType) Anno(ElementType.METHOD, ElementType.FIELD) fun foo() {} -Anno(ElementType.PACKAGE) val bar = 42 +@field:Anno(ElementType.PACKAGE) val bar = 42 Anno() fun baz() {} diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArrayArgument.txt b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArrayArgument.txt index a4eabd6ee5d..4eb176534d1 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArrayArgument.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/EnumArrayArgument.txt @@ -1,6 +1,6 @@ package test -test.Anno(t = {ElementType.PACKAGE}) internal val bar: kotlin.Int = 42 +@field:test.Anno(t = {ElementType.PACKAGE}) internal val bar: kotlin.Int = 42 internal fun (): kotlin.Int test.Anno(t = {}) internal fun baz(): kotlin.Unit test.Anno(t = {ElementType.METHOD, ElementType.FIELD}) internal fun foo(): kotlin.Unit diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/PropertyField.kt b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/PropertyField.kt index 065c669519f..1eec44b4221 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/PropertyField.kt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/PropertyField.kt @@ -2,4 +2,4 @@ package test annotation class Anno -@[Anno] var property: Int = 42 +@field:Anno var property: Int = 42 diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/PropertyField.txt b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/PropertyField.txt index 8f138279dfc..b59a063cf21 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/PropertyField.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/PropertyField.txt @@ -1,6 +1,6 @@ package test -test.Anno() internal var property: kotlin.Int +@field:test.Anno() internal var property: kotlin.Int internal fun (): kotlin.Int internal fun (/*0*/ : kotlin.Int): kotlin.Unit diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/StringArrayArgument.kt b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/StringArrayArgument.kt index 4ab3b748c0a..deff0fcd5df 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/StringArrayArgument.kt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/StringArrayArgument.kt @@ -5,6 +5,6 @@ annotation class Anno(vararg val t: String) Anno("live", "long") fun foo() {} -Anno("prosper") val bar = 42 +@field:Anno("prosper") val bar = 42 Anno() fun baz() {} diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/StringArrayArgument.txt b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/StringArrayArgument.txt index b5fd307a2f4..ba95ff7dd30 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/StringArrayArgument.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/StringArrayArgument.txt @@ -1,6 +1,6 @@ package test -test.Anno(t = {"prosper"}) internal val bar: kotlin.Int = 42 +@field:test.Anno(t = {"prosper"}) internal val bar: kotlin.Int = 42 internal fun (): kotlin.Int test.Anno(t = {}) internal fun baz(): kotlin.Unit test.Anno(t = {"live", "long"}) internal fun foo(): kotlin.Unit diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/parameters/Constructor.txt b/compiler/testData/loadJava/compiledKotlin/annotations/parameters/Constructor.txt index ab0e3a3c78c..dd2a5b1ab45 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/parameters/Constructor.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/parameters/Constructor.txt @@ -10,6 +10,6 @@ kotlin.annotation.annotation() internal final class B : kotlin.Annotation { internal final class Class { /*primary*/ public constructor Class(/*0*/ test.A() x: kotlin.Int, /*1*/ test.B() y: kotlin.String) - test.A() internal final val x: kotlin.Int + internal final val x: kotlin.Int internal final fun (): kotlin.Int } diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/parameters/EnumConstructor.txt b/compiler/testData/loadJava/compiledKotlin/annotations/parameters/EnumConstructor.txt index be566195504..7a4e379c352 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/parameters/EnumConstructor.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/parameters/EnumConstructor.txt @@ -10,9 +10,9 @@ kotlin.annotation.annotation() internal final class B : kotlin.Annotation { internal final enum class E : kotlin.Enum { /*primary*/ private constructor E(/*0*/ test.A() x: kotlin.String, /*1*/ test.B() y: kotlin.Int) - test.A() internal final val x: kotlin.String + internal final val x: kotlin.String internal final fun (): kotlin.String - test.B() internal final val y: kotlin.Int + internal final val y: kotlin.Int internal final fun (): kotlin.Int protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.E): kotlin.Int diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/parameters/InnerClassConstructor.txt b/compiler/testData/loadJava/compiledKotlin/annotations/parameters/InnerClassConstructor.txt index 41fe04dd9dc..9849c87044c 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/parameters/InnerClassConstructor.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/parameters/InnerClassConstructor.txt @@ -11,13 +11,13 @@ internal final class Outer { internal final inner class Inner { /*primary*/ public constructor Inner(/*0*/ test.A(s = "inner") y: kotlin.String) - test.A(s = "inner") internal final val y: kotlin.String + internal final val y: kotlin.String internal final fun (): kotlin.String } internal final class Nested { /*primary*/ public constructor Nested(/*0*/ test.A(s = "nested") x: kotlin.String) - test.A(s = "nested") internal final val x: kotlin.String + internal final val x: kotlin.String internal final fun (): kotlin.String } } diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/FieldTarget.txt b/compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/FieldTarget.txt index fd6b40dbb4d..6633ffe0994 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/FieldTarget.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/FieldTarget.txt @@ -10,3 +10,4 @@ internal final class Class { internal final fun (): kotlin.Int internal final fun (/*0*/ : kotlin.Int): kotlin.Unit } + diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/PropertyTarget.kt b/compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/PropertyTarget.kt deleted file mode 100644 index c066bb801ff..00000000000 --- a/compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/PropertyTarget.kt +++ /dev/null @@ -1,7 +0,0 @@ -package test - -annotation class Anno - -class Class { - @Anno var property: Int = 42 -} diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/PropertyTarget.txt b/compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/PropertyTarget.txt deleted file mode 100644 index 44c27f1ce64..00000000000 --- a/compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/PropertyTarget.txt +++ /dev/null @@ -1,12 +0,0 @@ -package test - -kotlin.annotation.annotation() internal final class Anno : kotlin.Annotation { - /*primary*/ public constructor Anno() -} - -internal final class Class { - /*primary*/ public constructor Class() - test.Anno() internal final var property: kotlin.Int - internal final fun (): kotlin.Int - internal final fun (/*0*/ : kotlin.Int): kotlin.Unit -} diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.kt b/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.kt index eeda69b8b20..8cccd3eedd0 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.kt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.kt @@ -8,7 +8,7 @@ annotation class A(val s: String) A("1") fun foo() = "foo" -A("2") +@field:A("2") var v: Int = 1 @platformName("vget") @A("3") diff --git a/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.txt b/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.txt index 3eb82760baf..24a0eddf1f9 100644 --- a/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.txt +++ b/compiler/testData/loadJava/compiledKotlinWithStdlib/platformNames/functionName.txt @@ -1,6 +1,6 @@ package test -test.A(s = "2") internal var v: kotlin.Int +@field:test.A(s = "2") internal var v: kotlin.Int kotlin.platform.platformName(name = "vget") test.A(s = "3") internal fun (): kotlin.Int kotlin.platform.platformName(name = "vset") test.A(s = "4") internal fun (/*0*/ : kotlin.Int): kotlin.Unit kotlin.platform.platformName(name = "bar") test.A(s = "1") internal fun foo(): kotlin.String diff --git a/compiler/testData/serialization/local/annotationsInLocalClass.txt b/compiler/testData/serialization/local/annotationsInLocalClass.txt index 96e332c62e0..647c01b9291 100644 --- a/compiler/testData/serialization/local/annotationsInLocalClass.txt +++ b/compiler/testData/serialization/local/annotationsInLocalClass.txt @@ -1,7 +1,7 @@ A.Ann(info = "class") local final class `A$foo$Local` public constructor `A$foo$Local`() -A.Ann(info = "val") internal final val x: `A$foo$Local` +@field:A.Ann(info = "val") internal final val x: `A$foo$Local` A.Ann(info = "fun") internal final fun foo(): `A$foo$Local` A.Ann(info = "inner") local final inner class Inner { diff --git a/compiler/testData/writeFlags/function/deprecatedFlag/getterForPropertyInConstructor.kt b/compiler/testData/writeFlags/function/deprecatedFlag/getterForPropertyInConstructor.kt index f4c2ee8bf5c..8579933fd44 100644 --- a/compiler/testData/writeFlags/function/deprecatedFlag/getterForPropertyInConstructor.kt +++ b/compiler/testData/writeFlags/function/deprecatedFlag/getterForPropertyInConstructor.kt @@ -1,4 +1,4 @@ -class MyClass(deprecated("") val test: Int) {} +class MyClass(@get:deprecated("") val test: Int) {} // TESTED_OBJECT_KIND: function // TESTED_OBJECTS: MyClass, getTest diff --git a/compiler/testData/writeFlags/function/deprecatedFlag/setterForPropertyInConstructor.kt b/compiler/testData/writeFlags/function/deprecatedFlag/setterForPropertyInConstructor.kt index 33b889fc8e8..64415247607 100644 --- a/compiler/testData/writeFlags/function/deprecatedFlag/setterForPropertyInConstructor.kt +++ b/compiler/testData/writeFlags/function/deprecatedFlag/setterForPropertyInConstructor.kt @@ -1,4 +1,4 @@ -class MyClass(deprecated("") var test: Int) {} +class MyClass(@set:deprecated("") var test: Int) {} // TESTED_OBJECT_KIND: function diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java index 2bc5d0223a3..22d2ef4f5ae 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java @@ -4605,6 +4605,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("propertyUseSiteTargetedAnnotations.kt") + public void testPropertyUseSiteTargetedAnnotations() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/deprecated/propertyUseSiteTargetedAnnotations.kt"); + doTest(fileName); + } + @TestMetadata("typeUsage.kt") public void testTypeUsage() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/deprecated/typeUsage.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeListingTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeListingTest.kt index e13c2ee30fd..88ad9898854 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeListingTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeListingTest.kt @@ -20,11 +20,9 @@ import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.JetTestUtils import org.jetbrains.org.objectweb.asm.* import java.io.File -import java.util.* public abstract class AbstractBytecodeListingTest : CodegenTestCase() { - throws(Exception::class) public fun doTest(filename: String) { createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.ALL) loadFileByFullPath(filename) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/AnnotationGenTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/AnnotationGenTest.java index 9eb66220640..1ff3fe86988 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/AnnotationGenTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/AnnotationGenTest.java @@ -152,7 +152,7 @@ public class AnnotationGenTest extends CodegenTestCase { } public void testPropFieldInConstructor() throws NoSuchFieldException, NoSuchMethodException { - loadText("class A (@[Deprecated] var x: Int) {}"); + loadText("class A (@field:Deprecated @param:Deprecated var x: Int) {}"); Class aClass = generateClass("A"); Constructor constructor = aClass.getDeclaredConstructor(int.class); assertNotNull(constructor); diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java index 18b431192f6..3ec6b5e4843 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java @@ -2376,12 +2376,6 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest { doTestCompiledKotlin(fileName); } - @TestMetadata("PropertyTarget.kt") - public void testPropertyTarget() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/PropertyTarget.kt"); - doTestCompiledKotlin(fileName); - } - @TestMetadata("ReceiverTarget.kt") public void testReceiverTarget() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/ReceiverTarget.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java index e6a2e0c255e..f349e92f4ab 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java @@ -485,12 +485,6 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD doTest(fileName); } - @TestMetadata("PropertyTarget.kt") - public void testPropertyTarget() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/PropertyTarget.kt"); - doTest(fileName); - } - @TestMetadata("ReceiverTarget.kt") public void testReceiverTarget() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/ReceiverTarget.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/resolve/annotation/AbstractAnnotationDescriptorResolveTest.java b/compiler/tests/org/jetbrains/kotlin/resolve/annotation/AbstractAnnotationDescriptorResolveTest.java index 0d063903825..4c6ba3030c2 100644 --- a/compiler/tests/org/jetbrains/kotlin/resolve/annotation/AbstractAnnotationDescriptorResolveTest.java +++ b/compiler/tests/org/jetbrains/kotlin/resolve/annotation/AbstractAnnotationDescriptorResolveTest.java @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.analyzer.AnalysisResult; import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment; import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor; +import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget; import org.jetbrains.kotlin.descriptors.annotations.AnnotationWithTarget; import org.jetbrains.kotlin.descriptors.annotations.Annotations; import org.jetbrains.kotlin.descriptors.impl.AnonymousFunctionDescriptor; @@ -138,7 +139,9 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFix } }, " "); - assertEquals(expectedAnnotation, actualAnnotation); + String expectedAnnotationWithTarget = "@" + AnnotationUseSiteTarget.FILE.getRenderName() + ":" + expectedAnnotation; + + assertEquals(expectedAnnotationWithTarget, actualAnnotation); } private void checkAnnotationOnLocalDeclarations(String expectedAnnotation) { @@ -149,7 +152,7 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFix } private static void checkAnnotationsOnProperty(String expectedAnnotation, PropertyDescriptor prop) { - checkDescriptor(expectedAnnotation, prop); + checkDescriptorWithTarget(expectedAnnotation, prop, AnnotationUseSiteTarget.FIELD); checkDescriptor(expectedAnnotation, prop.getGetter()); PropertySetterDescriptor propSetter = prop.getSetter(); assertNotNull(propSetter); @@ -363,12 +366,16 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFix return JetTestUtils.doLoadFile(file).replaceAll("ANNOTATION", annotationText); } - private static String renderAnnotations(Annotations annotations) { + private static String renderAnnotations(Annotations annotations, @Nullable final AnnotationUseSiteTarget defaultTarget) { return StringUtil.join(annotations.getAllAnnotations(), new Function() { @Override public String fun(AnnotationWithTarget annotationWithTarget) { - return WITH_ANNOTATION_ARGUMENT_TYPES.renderAnnotation( - annotationWithTarget.getAnnotation(), annotationWithTarget.getTarget()); + AnnotationUseSiteTarget targetToRender = annotationWithTarget.getTarget(); + if (targetToRender == defaultTarget) { + targetToRender = null; + } + + return WITH_ANNOTATION_ARGUMENT_TYPES.renderAnnotation(annotationWithTarget.getAnnotation(), targetToRender); } }, " "); } @@ -378,9 +385,14 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFix assertEquals("Failed to resolve annotation descriptor for " + member.toString(), expectedAnnotation, actual); } + private static void checkDescriptorWithTarget(String expectedAnnotation, DeclarationDescriptor member, AnnotationUseSiteTarget target) { + String actual = renderAnnotations(member.getAnnotations(), target); + assertEquals("Failed to resolve annotation descriptor for " + member.toString(), expectedAnnotation, actual); + } + @NotNull protected static String getAnnotations(DeclarationDescriptor member) { - return renderAnnotations(member.getAnnotations()); + return renderAnnotations(member.getAnnotations(), null); } @Override diff --git a/idea/testData/decompiler/stubBuilder/Annotations/Annotations.kt b/idea/testData/decompiler/stubBuilder/Annotations/Annotations.kt index 44b75847471..663fa536008 100644 --- a/idea/testData/decompiler/stubBuilder/Annotations/Annotations.kt +++ b/idea/testData/decompiler/stubBuilder/Annotations/Annotations.kt @@ -1,4 +1,4 @@ -a public class Annotations private @a constructor(private @a val c1: Int, @a val c2: Int) { +a public class Annotations private @a constructor(private @property:a @param:a val c1: Int, @property:a @param:a val c2: Int) { protected a fun f() { } diff --git a/idea/testData/decompiler/stubBuilder/TopLevelMembersAnnotatedPackage/topLevelMembersAnnotated.kt b/idea/testData/decompiler/stubBuilder/TopLevelMembersAnnotatedPackage/topLevelMembersAnnotated.kt index c6270d4460f..ac9b4332253 100644 --- a/idea/testData/decompiler/stubBuilder/TopLevelMembersAnnotatedPackage/topLevelMembersAnnotated.kt +++ b/idea/testData/decompiler/stubBuilder/TopLevelMembersAnnotatedPackage/topLevelMembersAnnotated.kt @@ -2,7 +2,7 @@ package a.b.c.topLevelMembersAnnotated import d.e.f.* -a b val i: Int = 0 +@property:a @property:b val i: Int = 0 a b fun f(@a @b p1: C): Int = 0 diff --git a/idea/tests/org/jetbrains/kotlin/idea/stubs/ResolveByStubTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/stubs/ResolveByStubTestGenerated.java index dd117194091..af77da4927b 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/stubs/ResolveByStubTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/stubs/ResolveByStubTestGenerated.java @@ -483,12 +483,6 @@ public class ResolveByStubTestGenerated extends AbstractResolveByStubTest { doTest(fileName); } - @TestMetadata("PropertyTarget.kt") - public void testPropertyTarget() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/PropertyTarget.kt"); - doTest(fileName); - } - @TestMetadata("ReceiverTarget.kt") public void testReceiverTarget() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/ReceiverTarget.kt");