Fix tests

This commit is contained in:
Yan Zhulanow
2015-08-06 18:59:37 +03:00
parent 552211b2f4
commit 2ce9903356
84 changed files with 221 additions and 195 deletions
+1 -1
View File
@@ -1254,7 +1254,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER}) kotlin.
/*primary*/ public constructor data() /*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 = ...) /*primary*/ public constructor deprecated(/*0*/ value: kotlin.String, /*1*/ replaceWith: kotlin.ReplaceWith = ...)
internal final val replaceWith: kotlin.ReplaceWith internal final val replaceWith: kotlin.ReplaceWith
internal final fun <get-replaceWith>(): kotlin.ReplaceWith internal final fun <get-replaceWith>(): kotlin.ReplaceWith
@@ -1,6 +1,6 @@
annotation(retention = AnnotationRetention.RUNTIME) class Simple(val value: String) annotation(retention = AnnotationRetention.RUNTIME) class Simple(val value: String)
@Simple("OK") @property:Simple("OK")
val foo: Int = 0 val foo: Int = 0
fun box(): String { fun box(): String {
+1 -1
View File
@@ -1,6 +1,6 @@
package test package test
enum class MyEnum(deprecated("") val ord: Int) { enum class MyEnum(@param:deprecated("") @property:deprecated("") val ord: Int) {
ENTRY(239); ENTRY(239);
fun f(Deprecated p: Int) { fun f(Deprecated p: Int) {
@@ -7,7 +7,7 @@ internal final class A {
public companion object Companion { public companion object Companion {
private constructor 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 internal final var test.A.c: kotlin.String
} }
} }
@@ -4,7 +4,7 @@ internal fun main(/*0*/ kotlin.Array<kotlin.String>): kotlin.Unit
internal object A { internal object A {
private constructor 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 internal final var test.A.c: kotlin.String
} }
@@ -2,7 +2,7 @@ package
internal final class Annotated { internal final class Annotated {
public constructor Annotated(/*0*/ ann() x: kotlin.Int) 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@@ -6,8 +6,8 @@ package a {
internal final class Test { internal final class Test {
public constructor Test(/*0*/ java.lang.Deprecated() s: kotlin.String, /*1*/ java.lang.SuppressWarnings(value = {}) x: kotlin.Int) 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 internal final val s: kotlin.String
java.lang.SuppressWarnings(value = {}) 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@@ -2,7 +2,7 @@ package
kotlin.annotation.annotation() internal final class RecursivelyAnnotated : kotlin.Annotation { kotlin.annotation.annotation() internal final class RecursivelyAnnotated : kotlin.Annotation {
public constructor RecursivelyAnnotated(/*0*/ RecursivelyAnnotated(x = 1) x: kotlin.Int) 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@@ -2,7 +2,7 @@ package
kotlin.annotation.annotation() internal final class RecursivelyAnnotated : kotlin.Annotation { kotlin.annotation.annotation() internal final class RecursivelyAnnotated : kotlin.Annotation {
public constructor RecursivelyAnnotated(/*0*/ RecursivelyAnnotated(x = 1) x: kotlin.Int) 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@@ -2,7 +2,7 @@ package
internal final class RecursivelyAnnotated { internal final class RecursivelyAnnotated {
public constructor RecursivelyAnnotated(/*0*/ RecursivelyAnnotated(x = 1) x: kotlin.Int) 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@@ -8,9 +8,9 @@ target(AnnotationTarget.FUNCTION)
annotation class base annotation class base
class My(x: Int) { class My(x: Int) {
<!WRONG_ANNOTATION_TARGET!>smartget<!> var y = x smartget var y = x
<!WRONG_ANNOTATION_TARGET!>@base<!> @smartget <!WRONG_ANNOTATION_TARGET!>@smartset<!> get <!WRONG_ANNOTATION_TARGET!>@base<!> @smartget <!WRONG_ANNOTATION_TARGET!>@smartset<!> get
<!WRONG_ANNOTATION_TARGET!>@base<!> <!WRONG_ANNOTATION_TARGET!>@smartget<!> @smartset set <!WRONG_ANNOTATION_TARGET!>@base<!> <!WRONG_ANNOTATION_TARGET!>@smartget<!> @smartset set
base <!WRONG_ANNOTATION_TARGET!>smartget<!> <!WRONG_ANNOTATION_TARGET!>smartset<!> fun foo() = y base <!WRONG_ANNOTATION_TARGET!>smartget<!> <!WRONG_ANNOTATION_TARGET!>smartset<!> fun foo() = y
} }
@@ -2,7 +2,7 @@ package
internal final class My { internal final class My {
public constructor My(/*0*/ x: kotlin.Int) 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 public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
base() smartget() smartset() internal final fun foo(): kotlin.Int base() smartget() smartset() internal final fun foo(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.ANNOTATION_CLASS}) k
base() internal final class correct { base() internal final class correct {
base() public constructor 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() 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER}) kotlin.
base() internal final class correct { base() internal final class correct {
base() public constructor 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 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.CONSTRUCTOR}) kotlin
base() internal final class correct { base() internal final class correct {
base() public constructor 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() 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -24,7 +24,7 @@ empty() internal final enum class My : kotlin.Enum<My> {
empty() internal final class correct { empty() internal final class correct {
empty() public constructor 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 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -8,7 +8,7 @@ annotation class common
// FILE: other.kt // FILE: other.kt
@file:special @file:special
package test package test
@@ -16,8 +16,8 @@ package test
// FILE: another.kt // FILE: another.kt
<!WRONG_ANNOTATION_TARGET!>@file:common<!> <!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@file:common<!>
package test package test
common class Correct common class Correct
@@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION}) kotlin.an
base() internal final class correct { base() internal final class correct {
base() public constructor 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() internal final val x: kotlin.Int
base() public final fun baz(): kotlin.Unit base() public final fun baz(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -24,7 +24,7 @@ incorrect() internal final enum class My : kotlin.Enum<My> {
incorrect() internal final class correct { incorrect() internal final class correct {
incorrect() public constructor 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 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -21,7 +21,7 @@ public class AnnotationTargets {
} }
@Target(ElementType.FIELD) @Target(ElementType.FIELD)
public @interface field { public @interface fieldann {
} }
@@ -62,18 +62,18 @@ import test.AnnotationTargets.*
base meta type <!WRONG_ANNOTATION_TARGET!>konstructor<!> annotation class KMeta base meta type <!WRONG_ANNOTATION_TARGET!>konstructor<!> annotation class KMeta
base <!WRONG_ANNOTATION_TARGET!>meta<!> type <!WRONG_ANNOTATION_TARGET!>method<!> <!WRONG_ANNOTATION_TARGET!>multiple<!> class KClass( base <!WRONG_ANNOTATION_TARGET!>meta<!> type <!WRONG_ANNOTATION_TARGET!>method<!> <!WRONG_ANNOTATION_TARGET!>multiple<!> class KClass(
@base @field <!WRONG_ANNOTATION_TARGET!>@parameter<!> val y: @base @fieldann @parameter val y:
<!WRONG_ANNOTATION_TARGET!>@base<!> <!WRONG_ANNOTATION_TARGET!>@type<!> Int) { <!WRONG_ANNOTATION_TARGET!>@base<!> <!WRONG_ANNOTATION_TARGET!>@type<!> Int) {
base multiple fieldann <!WRONG_ANNOTATION_TARGET!>local<!> val x = 0
@method <!WRONG_ANNOTATION_TARGET!>@konstructor<!> <!WRONG_ANNOTATION_TARGET!>@type<!> get
base multiple field <!WRONG_ANNOTATION_TARGET!>local<!> val x = 0
@method <!WRONG_ANNOTATION_TARGET!>@konstructor<!> <!WRONG_ANNOTATION_TARGET!>@type<!> get
base method multiple <!WRONG_ANNOTATION_TARGET!>konstructor<!> base method multiple <!WRONG_ANNOTATION_TARGET!>konstructor<!>
fun foo(@parameter <!WRONG_ANNOTATION_TARGET!>@type<!> i: fun foo(@parameter <!WRONG_ANNOTATION_TARGET!>@type<!> i:
<!WRONG_ANNOTATION_TARGET!>@base<!> <!WRONG_ANNOTATION_TARGET!>@multiple<!> Int <!WRONG_ANNOTATION_TARGET!>@base<!> <!WRONG_ANNOTATION_TARGET!>@multiple<!> Int
): <!WRONG_ANNOTATION_TARGET!>@field<!> <!WRONG_ANNOTATION_TARGET!>@parameter<!> Int { ): <!WRONG_ANNOTATION_TARGET!>@fieldann<!> <!WRONG_ANNOTATION_TARGET!>@parameter<!> Int {
@local @base <!WRONG_ANNOTATION_TARGET!>@multiple<!> <!WRONG_ANNOTATION_TARGET!>@field<!> val j = i + 1 @local @base <!WRONG_ANNOTATION_TARGET!>@multiple<!> <!WRONG_ANNOTATION_TARGET!>@fieldann<!> val j = i + 1
<!WRONG_ANNOTATION_TARGET!>@base<!> <!WRONG_ANNOTATION_TARGET!>@multiple<!> return j <!WRONG_ANNOTATION_TARGET!>@base<!> <!WRONG_ANNOTATION_TARGET!>@multiple<!> return j
} }
@@ -15,8 +15,8 @@ package test {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FIELD}) public final class field : kotlin.Annotation { kotlin.annotation.target(allowedTargets = {AnnotationTarget.FIELD}) public final class fieldann : kotlin.Annotation {
public constructor field() public constructor fieldann()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String 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.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() 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) 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.field() test.AnnotationTargets.local() internal final val x: kotlin.Int = 0 test.AnnotationTargets.base() test.AnnotationTargets.multiple() test.AnnotationTargets.fieldann() 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 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 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 hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.LOCAL_VARIABLE}) kot
base() internal final class correct { base() internal final class correct {
base() public constructor 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() 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.PROPERTY}) kotlin.an
base() internal final class correct { base() internal final class correct {
base() public constructor 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 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.TYPE}) kotlin.annota
base() internal final class correct { base() internal final class correct {
base() public constructor 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 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -3,7 +3,7 @@ target(AnnotationTarget.VALUE_PARAMETER) annotation class base
<!WRONG_ANNOTATION_TARGET!>base<!> annotation class derived <!WRONG_ANNOTATION_TARGET!>base<!> annotation class derived
<!WRONG_ANNOTATION_TARGET!>base<!> class correct(<!WRONG_ANNOTATION_TARGET!>base<!> val x: Int, base w: Int) { <!WRONG_ANNOTATION_TARGET!>base<!> class correct(base val x: Int, base w: Int) {
<!WRONG_ANNOTATION_TARGET!>base<!> constructor(): this(0, 0) <!WRONG_ANNOTATION_TARGET!>base<!> constructor(): this(0, 0)
} }
@@ -32,7 +32,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) ko
base() internal final class correct { base() internal final class correct {
base() public constructor correct() base() public constructor correct()
public constructor correct(/*0*/ base() x: kotlin.Int, /*1*/ base() w: kotlin.Int) 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@@ -4,10 +4,10 @@ class CustomDelegate {
public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name
} }
<!INAPPLICABLE_FIELD_TARGET, WRONG_ANNOTATION_TARGET!>@field:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@field:Ann<!>
class SomeClass { class SomeClass {
<!INAPPLICABLE_FIELD_TARGET, WRONG_ANNOTATION_TARGET!>@field:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@field:Ann<!>
constructor() constructor()
@field:Ann @field:Ann
@@ -23,12 +23,12 @@ class SomeClass {
val propertyWithCustomGetter: Int val propertyWithCustomGetter: Int
get() = 5 get() = 5
<!INAPPLICABLE_FIELD_TARGET, WRONG_ANNOTATION_TARGET!>@field:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@field:Ann<!>
fun anotherFun(<!INAPPLICABLE_FIELD_TARGET!>@field:Ann<!> <!UNUSED_PARAMETER!>s<!>: String) { fun anotherFun(<!INAPPLICABLE_TARGET_ON_PROPERTY!>@field:Ann<!> <!UNUSED_PARAMETER!>s<!>: String) {
<!INAPPLICABLE_FIELD_TARGET!>@field:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY!>@field:Ann<!>
val <!UNUSED_VARIABLE!>localVariable<!> = 5 val <!UNUSED_VARIABLE!>localVariable<!> = 5
} }
} }
class WithPrimaryConstructor(<!INAPPLICABLE_FIELD_TARGET!>@field:Ann<!> val a: String) class WithPrimaryConstructor(@field:Ann val a: String)
@@ -28,7 +28,7 @@ internal final class CustomDelegate {
} }
internal final class WithPrimaryConstructor { 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 @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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -4,10 +4,10 @@ class CustomDelegate {
public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name
} }
<!INAPPLICABLE_GET_TARGET, WRONG_ANNOTATION_TARGET!>@get:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@get:Ann<!>
class SomeClass { class SomeClass {
<!INAPPLICABLE_GET_TARGET, WRONG_ANNOTATION_TARGET!>@get:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@get:Ann<!>
constructor() constructor()
@get:Ann @get:Ann
@@ -26,11 +26,11 @@ class SomeClass {
val propertyWithCustomGetter: Int val propertyWithCustomGetter: Int
get() = 5 get() = 5
<!INAPPLICABLE_GET_TARGET, WRONG_ANNOTATION_TARGET!>@get:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@get:Ann<!>
fun annotationOnFunction(a: Int) = a + 5 fun annotationOnFunction(a: Int) = a + 5
fun anotherFun() { fun anotherFun() {
<!INAPPLICABLE_GET_TARGET!>@get:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY!>@get:Ann<!>
val <!UNUSED_VARIABLE!>localVariable<!> = 5 val <!UNUSED_VARIABLE!>localVariable<!> = 5
} }
@@ -17,11 +17,11 @@ internal final class CustomDelegate {
@get:Ann() internal final class SomeClass { @get:Ann() internal final class SomeClass {
@get:Ann() public constructor SomeClass() @get:Ann() public constructor SomeClass()
@get:Ann() protected final val delegatedProperty: kotlin.String protected final val delegatedProperty: kotlin.String
@get:Ann() protected final var mutableProperty: kotlin.String protected final var mutableProperty: kotlin.String
@get:Ann() internal final val propertyWithCustomGetter: kotlin.Int internal final val propertyWithCustomGetter: kotlin.Int
@get:Ann() protected final val simpleProperty: kotlin.String = "text" protected final val simpleProperty: kotlin.String = "text"
@get:Ann() protected final val simplePropertyWithAnnotationList: kotlin.String = "text" protected final val simplePropertyWithAnnotationList: kotlin.String = "text"
@get:Ann() internal final fun annotationOnFunction(/*0*/ a: kotlin.Int): kotlin.Int @get:Ann() internal final fun annotationOnFunction(/*0*/ a: kotlin.Int): kotlin.Int
internal final fun anotherFun(): kotlin.Unit 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -1,24 +1,24 @@
annotation class Ann annotation class Ann
annotation class Second annotation class Second
<!INAPPLICABLE_SPARAM_TARGET, WRONG_ANNOTATION_TARGET!>@param:Ann<!> <!INAPPLICABLE_PARAM_TARGET, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@param:Ann<!>
class SomeClass { class SomeClass {
<!INAPPLICABLE_SPARAM_TARGET, WRONG_ANNOTATION_TARGET!>@param:Ann<!> <!INAPPLICABLE_PARAM_TARGET, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@param:Ann<!>
constructor(<!INAPPLICABLE_SPARAM_TARGET!>@param:Ann<!> <!UNUSED_PARAMETER!>a<!>: String) constructor(<!INAPPLICABLE_PARAM_TARGET!>@param:Ann<!> <!UNUSED_PARAMETER!>a<!>: String)
<!INAPPLICABLE_SPARAM_TARGET!>@param:Ann<!> <!INAPPLICABLE_PARAM_TARGET!>@param:Ann<!>
protected val simpleProperty: String = "text" protected val simpleProperty: String = "text"
<!INAPPLICABLE_SPARAM_TARGET!>@param:Ann<!> <!INAPPLICABLE_PARAM_TARGET!>@param:Ann<!>
fun anotherFun() { fun anotherFun() {
<!INAPPLICABLE_SPARAM_TARGET!>@param:Ann<!> <!INAPPLICABLE_PARAM_TARGET!>@param:Ann<!>
val <!UNUSED_VARIABLE!>localVariable<!> = 5 val <!UNUSED_VARIABLE!>localVariable<!> = 5
} }
} }
class PrimaryConstructorClass( class PrimaryConstructorClass(
@param:Ann <!UNUSED_PARAMETER!>a<!>: String, <!REDUNDANT_ANNOTATION_TARGET!>@param:Ann<!> <!UNUSED_PARAMETER!>a<!>: String,
@param:[Ann Second] <!UNUSED_PARAMETER!>b<!>: String, @param:[<!REDUNDANT_ANNOTATION_TARGET!>Ann<!> <!REDUNDANT_ANNOTATION_TARGET!>Second<!>] <!UNUSED_PARAMETER!>b<!>: String,
@param:Ann val <!UNUSED_PARAMETER!>c<!>: String) @param:Ann val c: String)
@@ -8,7 +8,8 @@ kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation {
} }
internal final class PrimaryConstructorClass { 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@@ -5,10 +5,10 @@ class CustomDelegate {
public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name
} }
<!INAPPLICABLE_PROPERTY_TARGET, WRONG_ANNOTATION_TARGET!>@property:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@property:Ann<!>
class SomeClass { class SomeClass {
<!INAPPLICABLE_PROPERTY_TARGET, WRONG_ANNOTATION_TARGET!>@property:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@property:Ann<!>
constructor(<!UNUSED_PARAMETER!>s<!>: String) constructor(<!UNUSED_PARAMETER!>s<!>: String)
@property:Ann @property:Ann
@@ -28,9 +28,9 @@ class SomeClass {
get() = 5 get() = 5
set(v) {} set(v) {}
<!INAPPLICABLE_PROPERTY_TARGET, WRONG_ANNOTATION_TARGET!>@property:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@property:Ann<!>
fun anotherFun() { fun anotherFun() {
<!INAPPLICABLE_PROPERTY_TARGET, WRONG_ANNOTATION_TARGET!>@property:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY!>@property:Ann<!>
val <!UNUSED_VARIABLE!>localVariable<!> = 5 val <!UNUSED_VARIABLE!>localVariable<!> = 5
} }
@@ -1,9 +1,9 @@
annotation class Ann annotation class Ann
<!INAPPLICABLE_RECEIVER_TARGET, WRONG_ANNOTATION_TARGET!>@receiver:Ann<!> <!INAPPLICABLE_RECEIVER_TARGET, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@receiver:Ann<!>
class SomeClass { class SomeClass {
<!INAPPLICABLE_RECEIVER_TARGET, WRONG_ANNOTATION_TARGET!>@receiver:Ann<!> <!INAPPLICABLE_RECEIVER_TARGET, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@receiver:Ann<!>
constructor(<!INAPPLICABLE_RECEIVER_TARGET!>@receiver:Ann<!> <!UNUSED_PARAMETER!>a<!>: String) constructor(<!INAPPLICABLE_RECEIVER_TARGET!>@receiver:Ann<!> <!UNUSED_PARAMETER!>a<!>: String)
<!INAPPLICABLE_RECEIVER_TARGET!>@receiver:Ann<!> <!INAPPLICABLE_RECEIVER_TARGET!>@receiver:Ann<!>
@@ -15,14 +15,11 @@ class SomeClass {
val <!UNUSED_VARIABLE!>localVariable<!> = 5 val <!UNUSED_VARIABLE!>localVariable<!> = 5
} }
@receiver:Ann val @receiver:Ann String.extensionProperty2: String
val String.extensionProperty2: String
get() = "A" get() = "A"
} }
@receiver:Ann fun @receiver:Ann String.length2() = length()
fun String.length2() = length()
@receiver:Ann val @receiver:Ann String.extensionProperty: String
val String.extensionProperty: String
get() = "A" get() = "A"
@@ -1,7 +1,7 @@
package package
@receiver:Ann() internal val kotlin.String.extensionProperty: kotlin.String internal val @receiver:Ann() kotlin.String.extensionProperty: kotlin.String
@receiver:Ann() internal fun kotlin.String.length2(): kotlin.Int internal fun @receiver:Ann() kotlin.String.length2(): kotlin.Int
kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation { kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation {
public constructor Ann() public constructor Ann()
@@ -13,6 +13,7 @@ kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation {
@receiver:Ann() internal final class SomeClass { @receiver:Ann() internal final class SomeClass {
@receiver:Ann() public constructor SomeClass(/*0*/ @receiver:Ann() a: kotlin.String) @receiver:Ann() public constructor SomeClass(/*0*/ @receiver:Ann() a: kotlin.String)
@receiver:Ann() protected final val simpleProperty: kotlin.String = "text" @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 @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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -5,7 +5,7 @@ class CustomDelegate {
fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {} fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {}
} }
<!INAPPLICABLE_SET_TARGET, WRONG_ANNOTATION_TARGET!>@set:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@set:Ann<!>
class SomeClass { class SomeClass {
<!INAPPLICABLE_TARGET_PROPERTY_IMMUTABLE!>@set:Ann<!> <!INAPPLICABLE_TARGET_PROPERTY_IMMUTABLE!>@set:Ann<!>
@@ -25,11 +25,11 @@ class SomeClass {
get() = 5 get() = 5
set(v) {} set(v) {}
<!INAPPLICABLE_SET_TARGET, WRONG_ANNOTATION_TARGET!>@set:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@set:Ann<!>
fun annotationOnFunction(a: Int) = a + 5 fun annotationOnFunction(a: Int) = a + 5
fun anotherFun() { fun anotherFun() {
<!INAPPLICABLE_SET_TARGET!>@set:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY!>@set:Ann<!>
val <!UNUSED_VARIABLE!>localVariable<!> = 5 val <!UNUSED_VARIABLE!>localVariable<!> = 5
} }
@@ -18,10 +18,10 @@ internal final class CustomDelegate {
@set:Ann() internal final class SomeClass { @set:Ann() internal final class SomeClass {
public constructor SomeClass() public constructor SomeClass()
@set:Ann() protected final var delegatedProperty: kotlin.String protected final var delegatedProperty: kotlin.String
@set:Ann() protected final var mutableProperty: kotlin.String protected final var mutableProperty: kotlin.String
@set:Ann() protected final var mutablePropertyWithAnnotationList: kotlin.String protected final var mutablePropertyWithAnnotationList: kotlin.String
@set:Ann() internal final var propertyWithCustomSetter: kotlin.Int internal final var propertyWithCustomSetter: kotlin.Int
@set:Ann() protected final val simpleProperty: kotlin.String = "text" @set:Ann() protected final val simpleProperty: kotlin.String = "text"
@set:Ann() internal final fun annotationOnFunction(/*0*/ a: kotlin.Int): kotlin.Int @set:Ann() internal final fun annotationOnFunction(/*0*/ a: kotlin.Int): kotlin.Int
internal final fun anotherFun(): kotlin.Unit internal final fun anotherFun(): kotlin.Unit
@@ -5,10 +5,10 @@ class CustomDelegate {
fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {} fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {}
} }
<!INAPPLICABLE_SPARAM_TARGET, WRONG_ANNOTATION_TARGET!>@sparam:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@sparam:Ann<!>
class SomeClass { class SomeClass {
<!INAPPLICABLE_SPARAM_TARGET, WRONG_ANNOTATION_TARGET!>@sparam:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@sparam:Ann<!>
constructor() constructor()
<!INAPPLICABLE_TARGET_PROPERTY_IMMUTABLE!>@sparam:Ann<!> <!INAPPLICABLE_TARGET_PROPERTY_IMMUTABLE!>@sparam:Ann<!>
@@ -28,9 +28,9 @@ class SomeClass {
get() = 5 get() = 5
set(v) {} set(v) {}
<!INAPPLICABLE_SPARAM_TARGET!>@sparam:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY!>@sparam:Ann<!>
fun anotherFun() { fun anotherFun() {
<!INAPPLICABLE_SPARAM_TARGET!>@sparam:Ann<!> <!INAPPLICABLE_TARGET_ON_PROPERTY!>@sparam:Ann<!>
val <!UNUSED_VARIABLE!>localVariable<!> = 5 val <!UNUSED_VARIABLE!>localVariable<!> = 5
} }
@@ -1,4 +1,4 @@
annotation(repeatable = true) class RepeatableAnn annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class RepeatableAnn
annotation class Ann annotation class Ann
public class A(@param:Ann <!REPEATED_ANNOTATION!>@Ann<!> val x: Int, @param: RepeatableAnn @Ann val y: Int) { public class A(@param:Ann <!REPEATED_ANNOTATION!>@Ann<!> val x: Int, @param: RepeatableAnn @Ann val y: Int) {
@@ -1,11 +1,11 @@
package package
public final class A { public final class A {
public constructor A(/*0*/ Ann() Ann() x: kotlin.Int, /*1*/ RepeatableAnn() Ann() y: kotlin.Int) public constructor A(/*0*/ @param:Ann() Ann() x: kotlin.Int, /*1*/ @param:RepeatableAnn() Ann() y: kotlin.Int)
Ann() RepeatableAnn() Ann() RepeatableAnn() internal final val a: kotlin.Int = 0 @property:Ann() @property:RepeatableAnn() @field:Ann() RepeatableAnn() internal final val a: kotlin.Int = 0
Ann() Ann() Ann() internal final val b: kotlin.Int = 0 @property:Ann() Ann() @field:Ann() internal final val b: kotlin.Int = 0
RepeatableAnn() RepeatableAnn() internal final val c: kotlin.Int = 0 @field:RepeatableAnn() @field:RepeatableAnn() internal final val c: kotlin.Int = 0
RepeatableAnn() RepeatableAnn() internal final val d: kotlin.Int = 0 @property:RepeatableAnn() RepeatableAnn() internal final val d: kotlin.Int = 0
internal final val x: kotlin.Int internal final val x: kotlin.Int
internal final val y: kotlin.Int internal final val y: kotlin.Int
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 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 constructor RepeatableAnn()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,3 +1,4 @@
target(AnnotationTarget.TYPE, AnnotationTarget.FUNCTION)
annotation class a annotation class a
interface A interface A
interface B interface B
@@ -29,7 +29,7 @@ internal final class Outer {
internal final fun B.<no name provided>(): kotlin.Unit internal final fun B.<no name provided>(): 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 constructor a()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -10,7 +10,7 @@ kotlin.deprecated(value = "Deprecated in Java") public open class A {
internal final class B : A { internal final class B : A {
public constructor B(/*0*/ foo: kotlin.String) 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*/ /*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*/ fun getFoo(/*0*/ text: kotlin.String): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -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.<!DEPRECATED_SYMBOL_WITH_MESSAGE!>a1<!>
holder.<!DEPRECATED_SYMBOL_WITH_MESSAGE!>a2<!>
holder.<!DEPRECATED_SYMBOL_WITH_MESSAGE!>withGetter<!>
holder.<!DEPRECATED_SYMBOL_WITH_MESSAGE!>withSetter<!> = "A"
}
fun literals() {
PropertyHolder::<!DEPRECATED_SYMBOL_WITH_MESSAGE!>a1<!>
PropertyHolder::<!DEPRECATED_SYMBOL_WITH_MESSAGE!>a2<!>
PropertyHolder::withGetter
PropertyHolder::withSetter
}
@@ -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
}
@@ -126,7 +126,7 @@ package illegal_modifiers {
internal final class LegalModifier { 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*/) 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 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 equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@@ -1,4 +1,4 @@
class Aaa() { class Aaa() {
val <!REDECLARATION!>a<!> = 1 val <!REDECLARATION!>a<!> = 1
val <!REDECLARATION!>a<!> = 1 val <!REDECLARATION!>a<!> = 1
} }
@@ -1,4 +1,4 @@
class Aaa() { class Aaa() {
val <!REDECLARATION!>a<!> = 1 val <!REDECLARATION!>a<!> = 1
val <!REDECLARATION!>a<!> = "" val <!REDECLARATION!>a<!> = ""
} }
@@ -6,10 +6,10 @@ fun foo() {}
@jvmName("b") @jvmName("b")
fun Any.foo() {} fun Any.foo() {}
<!WRONG_ANNOTATION_TARGET!>@jvmName("c")<!> @jvmName("c")
val px = 1 val px = 1
<!WRONG_ANNOTATION_TARGET!>@jvmName("d")<!> @jvmName("d")
val Any.px : Int val Any.px : Int
get() = 1 get() = 1
@@ -39,22 +39,22 @@ class C <!WRONG_ANNOTATION_TARGET!>jvmName("primary")<!> constructor() {
@jvmName("b") @jvmName("b")
fun Any.foo() {} fun Any.foo() {}
<!WRONG_ANNOTATION_TARGET!>@jvmName("c")<!> @jvmName("c")
val px = 1 val px = 1
<!WRONG_ANNOTATION_TARGET!>@jvmName("d")<!> @jvmName("d")
val Any.px : Int val Any.px : Int
get() = 1 get() = 1
val valx: Int val valx: Int
@jvmName("e") @jvmName("e")
get() = 1 get() = 1
var varx: Int var varx: Int
@jvmName("f") @jvmName("f")
get() = 1 get() = 1
@jvmName("g") @jvmName("g")
set(v) {} set(v) {}
} }
fun foo1() { fun foo1() {
@@ -86,4 +86,4 @@ class D: AB() {
@jvmName("D_finalFun") @jvmName("D_finalFun")
fun finalFun() {} fun finalFun() {}
} }
@@ -1,10 +1,10 @@
package package
kotlin.jvm.jvmName(name = "c") internal val px: kotlin.Int = 1 internal val px: kotlin.Int = 1
internal val valx: kotlin.Int internal val valx: kotlin.Int
internal var vardef: kotlin.Int internal var vardef: kotlin.Int
internal var varx: 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 kotlin.jvm.jvmName(name = "a") internal fun foo(): kotlin.Unit
internal fun foo1(): kotlin.Unit internal fun foo1(): kotlin.Unit
kotlin.jvm.jvmName(name = "b") internal fun kotlin.Any.foo(): 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 = "C") internal final class C {
kotlin.jvm.jvmName(name = "primary") public constructor 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 = "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 val valx: kotlin.Int
internal final var varx: 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 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 kotlin.jvm.jvmName(name = "a") internal final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -4,6 +4,6 @@ annotation class Anno
class Class { class Class {
companion object { companion object {
@[Anno] var property: Int = 42 @field:Anno var property: Int = 42
} }
} }
@@ -9,7 +9,7 @@ internal final class Class {
public companion object Companion { public companion object Companion {
/*primary*/ private constructor 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 <get-property>(): kotlin.Int internal final fun <get-property>(): kotlin.Int
internal final fun <set-property>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit internal final fun <set-property>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
} }
@@ -8,5 +8,5 @@ annotation class Anno(val t: ElementType)
class Class { class Class {
Anno(ElementType.METHOD) fun foo() {} Anno(ElementType.METHOD) fun foo() {}
Anno(ElementType.FIELD) var bar = 42 @field:Anno(ElementType.FIELD) var bar = 42
} }
@@ -8,7 +8,7 @@ kotlin.annotation.annotation() internal final class Anno : kotlin.Annotation {
internal final class Class { internal final class Class {
/*primary*/ public constructor 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 <get-bar>(): kotlin.Int internal final fun <get-bar>(): kotlin.Int
internal final fun <set-bar>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit internal final fun <set-bar>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
test.Anno(t = ElementType.METHOD) internal final fun foo(): kotlin.Unit test.Anno(t = ElementType.METHOD) internal final fun foo(): kotlin.Unit
@@ -3,5 +3,5 @@ package test
annotation class Anno annotation class Anno
class Class { class Class {
@[Anno] var property: Int = 42 @field:Anno var property: Int = 42
} }
@@ -6,7 +6,7 @@ kotlin.annotation.annotation() internal final class Anno : kotlin.Annotation {
internal final class Class { internal final class Class {
/*primary*/ public constructor 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 <get-property>(): kotlin.Int internal final fun <get-property>(): kotlin.Int
internal final fun <set-property>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit internal final fun <set-property>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
} }
@@ -7,4 +7,4 @@ annotation class Anno(val t: ElementType)
Anno(ElementType.METHOD) fun foo() {} Anno(ElementType.METHOD) fun foo() {}
Anno(ElementType.FIELD) val bar = 42 @field:Anno(ElementType.FIELD) val bar = 42
@@ -1,6 +1,6 @@
package test 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 <get-bar>(): kotlin.Int internal fun <get-bar>(): kotlin.Int
test.Anno(t = ElementType.METHOD) internal fun foo(): kotlin.Unit test.Anno(t = ElementType.METHOD) internal fun foo(): kotlin.Unit
@@ -7,6 +7,6 @@ annotation class Anno(vararg val t: ElementType)
Anno(ElementType.METHOD, ElementType.FIELD) fun foo() {} Anno(ElementType.METHOD, ElementType.FIELD) fun foo() {}
Anno(ElementType.PACKAGE) val bar = 42 @field:Anno(ElementType.PACKAGE) val bar = 42
Anno() fun baz() {} Anno() fun baz() {}
@@ -1,6 +1,6 @@
package test 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 <get-bar>(): kotlin.Int internal fun <get-bar>(): kotlin.Int
test.Anno(t = {}) internal fun baz(): kotlin.Unit test.Anno(t = {}) internal fun baz(): kotlin.Unit
test.Anno(t = {ElementType.METHOD, ElementType.FIELD}) internal fun foo(): kotlin.Unit test.Anno(t = {ElementType.METHOD, ElementType.FIELD}) internal fun foo(): kotlin.Unit
@@ -2,4 +2,4 @@ package test
annotation class Anno annotation class Anno
@[Anno] var property: Int = 42 @field:Anno var property: Int = 42
@@ -1,6 +1,6 @@
package test package test
test.Anno() internal var property: kotlin.Int @field:test.Anno() internal var property: kotlin.Int
internal fun <get-property>(): kotlin.Int internal fun <get-property>(): kotlin.Int
internal fun <set-property>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit internal fun <set-property>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
@@ -5,6 +5,6 @@ annotation class Anno(vararg val t: String)
Anno("live", "long") fun foo() {} Anno("live", "long") fun foo() {}
Anno("prosper") val bar = 42 @field:Anno("prosper") val bar = 42
Anno() fun baz() {} Anno() fun baz() {}
@@ -1,6 +1,6 @@
package test 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 <get-bar>(): kotlin.Int internal fun <get-bar>(): kotlin.Int
test.Anno(t = {}) internal fun baz(): kotlin.Unit test.Anno(t = {}) internal fun baz(): kotlin.Unit
test.Anno(t = {"live", "long"}) internal fun foo(): kotlin.Unit test.Anno(t = {"live", "long"}) internal fun foo(): kotlin.Unit
@@ -10,6 +10,6 @@ kotlin.annotation.annotation() internal final class B : kotlin.Annotation {
internal final class Class { internal final class Class {
/*primary*/ public constructor Class(/*0*/ test.A() x: kotlin.Int, /*1*/ test.B() y: kotlin.String) /*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 <get-x>(): kotlin.Int internal final fun <get-x>(): kotlin.Int
} }
@@ -10,9 +10,9 @@ kotlin.annotation.annotation() internal final class B : kotlin.Annotation {
internal final enum class E : kotlin.Enum<test.E> { internal final enum class E : kotlin.Enum<test.E> {
/*primary*/ private constructor E(/*0*/ test.A() x: kotlin.String, /*1*/ test.B() y: kotlin.Int) /*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 <get-x>(): kotlin.String internal final fun <get-x>(): kotlin.String
test.B() internal final val y: kotlin.Int internal final val y: kotlin.Int
internal final fun <get-y>(): kotlin.Int internal final fun <get-y>(): kotlin.Int
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.E): kotlin.Int public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.E): kotlin.Int
@@ -11,13 +11,13 @@ internal final class Outer {
internal final inner class Inner { internal final inner class Inner {
/*primary*/ public constructor Inner(/*0*/ test.A(s = "inner") y: kotlin.String) /*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 <get-y>(): kotlin.String internal final fun <get-y>(): kotlin.String
} }
internal final class Nested { internal final class Nested {
/*primary*/ public constructor Nested(/*0*/ test.A(s = "nested") x: kotlin.String) /*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 <get-x>(): kotlin.String internal final fun <get-x>(): kotlin.String
} }
} }
@@ -10,3 +10,4 @@ internal final class Class {
internal final fun <get-property>(): kotlin.Int internal final fun <get-property>(): kotlin.Int
internal final fun <set-property>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit internal final fun <set-property>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
} }
@@ -1,7 +0,0 @@
package test
annotation class Anno
class Class {
@Anno var property: Int = 42
}
@@ -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 <get-property>(): kotlin.Int
internal final fun <set-property>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
}
@@ -8,7 +8,7 @@ annotation class A(val s: String)
A("1") A("1")
fun foo() = "foo" fun foo() = "foo"
A("2") @field:A("2")
var v: Int = 1 var v: Int = 1
@platformName("vget") @platformName("vget")
@A("3") @A("3")
@@ -1,6 +1,6 @@
package test 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 <get-v>(): kotlin.Int kotlin.platform.platformName(name = "vget") test.A(s = "3") internal fun <get-v>(): kotlin.Int
kotlin.platform.platformName(name = "vset") test.A(s = "4") internal fun <set-v>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit kotlin.platform.platformName(name = "vset") test.A(s = "4") internal fun <set-v>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
kotlin.platform.platformName(name = "bar") test.A(s = "1") internal fun foo(): kotlin.String kotlin.platform.platformName(name = "bar") test.A(s = "1") internal fun foo(): kotlin.String
@@ -1,7 +1,7 @@
A.Ann(info = "class") local final class `A$foo$Local` A.Ann(info = "class") local final class `A$foo$Local`
public constructor `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 = "fun") internal final fun foo(): `A$foo$Local`
A.Ann(info = "inner") local final inner class Inner { A.Ann(info = "inner") local final inner class Inner {
@@ -1,4 +1,4 @@
class MyClass(deprecated("") val test: Int) {} class MyClass(@get:deprecated("") val test: Int) {}
// TESTED_OBJECT_KIND: function // TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: MyClass, getTest // TESTED_OBJECTS: MyClass, getTest
@@ -1,4 +1,4 @@
class MyClass(deprecated("") var test: Int) {} class MyClass(@set:deprecated("") var test: Int) {}
// TESTED_OBJECT_KIND: function // TESTED_OBJECT_KIND: function
@@ -4605,6 +4605,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName); 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") @TestMetadata("typeUsage.kt")
public void testTypeUsage() throws Exception { public void testTypeUsage() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/deprecated/typeUsage.kt"); String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/deprecated/typeUsage.kt");
@@ -20,11 +20,9 @@ import org.jetbrains.kotlin.test.ConfigurationKind
import org.jetbrains.kotlin.test.JetTestUtils import org.jetbrains.kotlin.test.JetTestUtils
import org.jetbrains.org.objectweb.asm.* import org.jetbrains.org.objectweb.asm.*
import java.io.File import java.io.File
import java.util.*
public abstract class AbstractBytecodeListingTest : CodegenTestCase() { public abstract class AbstractBytecodeListingTest : CodegenTestCase() {
throws(Exception::class)
public fun doTest(filename: String) { public fun doTest(filename: String) {
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.ALL) createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.ALL)
loadFileByFullPath(filename) loadFileByFullPath(filename)
@@ -152,7 +152,7 @@ public class AnnotationGenTest extends CodegenTestCase {
} }
public void testPropFieldInConstructor() throws NoSuchFieldException, NoSuchMethodException { 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"); Class<?> aClass = generateClass("A");
Constructor constructor = aClass.getDeclaredConstructor(int.class); Constructor constructor = aClass.getDeclaredConstructor(int.class);
assertNotNull(constructor); assertNotNull(constructor);
@@ -2376,12 +2376,6 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
doTestCompiledKotlin(fileName); 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") @TestMetadata("ReceiverTarget.kt")
public void testReceiverTarget() throws Exception { public void testReceiverTarget() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/ReceiverTarget.kt"); String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/ReceiverTarget.kt");
@@ -485,12 +485,6 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD
doTest(fileName); 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") @TestMetadata("ReceiverTarget.kt")
public void testReceiverTarget() throws Exception { public void testReceiverTarget() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/ReceiverTarget.kt"); String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/ReceiverTarget.kt");
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.analyzer.AnalysisResult;
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment; import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor; 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.AnnotationWithTarget;
import org.jetbrains.kotlin.descriptors.annotations.Annotations; import org.jetbrains.kotlin.descriptors.annotations.Annotations;
import org.jetbrains.kotlin.descriptors.impl.AnonymousFunctionDescriptor; 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) { private void checkAnnotationOnLocalDeclarations(String expectedAnnotation) {
@@ -149,7 +152,7 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFix
} }
private static void checkAnnotationsOnProperty(String expectedAnnotation, PropertyDescriptor prop) { private static void checkAnnotationsOnProperty(String expectedAnnotation, PropertyDescriptor prop) {
checkDescriptor(expectedAnnotation, prop); checkDescriptorWithTarget(expectedAnnotation, prop, AnnotationUseSiteTarget.FIELD);
checkDescriptor(expectedAnnotation, prop.getGetter()); checkDescriptor(expectedAnnotation, prop.getGetter());
PropertySetterDescriptor propSetter = prop.getSetter(); PropertySetterDescriptor propSetter = prop.getSetter();
assertNotNull(propSetter); assertNotNull(propSetter);
@@ -363,12 +366,16 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFix
return JetTestUtils.doLoadFile(file).replaceAll("ANNOTATION", annotationText); 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<AnnotationWithTarget, String>() { return StringUtil.join(annotations.getAllAnnotations(), new Function<AnnotationWithTarget, String>() {
@Override @Override
public String fun(AnnotationWithTarget annotationWithTarget) { public String fun(AnnotationWithTarget annotationWithTarget) {
return WITH_ANNOTATION_ARGUMENT_TYPES.renderAnnotation( AnnotationUseSiteTarget targetToRender = annotationWithTarget.getTarget();
annotationWithTarget.getAnnotation(), 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); 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 @NotNull
protected static String getAnnotations(DeclarationDescriptor member) { protected static String getAnnotations(DeclarationDescriptor member) {
return renderAnnotations(member.getAnnotations()); return renderAnnotations(member.getAnnotations(), null);
} }
@Override @Override
@@ -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() { protected a fun f() {
} }
@@ -2,7 +2,7 @@ package a.b.c.topLevelMembersAnnotated
import d.e.f.* 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 a b fun f(@a @b p1: C): Int = 0
@@ -483,12 +483,6 @@ public class ResolveByStubTestGenerated extends AbstractResolveByStubTest {
doTest(fileName); 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") @TestMetadata("ReceiverTarget.kt")
public void testReceiverTarget() throws Exception { public void testReceiverTarget() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/ReceiverTarget.kt"); String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/annotations/withUseSiteTarget/ReceiverTarget.kt");