Adjust testData: get rid of obsolete annotations
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
annotation class Foo(val s: String)
|
annotation class Foo(val s: String)
|
||||||
|
|
||||||
[Foo("...")]
|
@Foo("...")
|
||||||
class ExtraAnnotations
|
class ExtraAnnotations
|
||||||
@@ -29,9 +29,9 @@ interface Trait
|
|||||||
deprecated("") class Deprecated
|
deprecated("") class Deprecated
|
||||||
kotlin.deprecated("") class DeprecatedFQN
|
kotlin.deprecated("") class DeprecatedFQN
|
||||||
kotlin. deprecated /**/ ("") class DeprecatedFQNSpaces
|
kotlin. deprecated /**/ ("") class DeprecatedFQNSpaces
|
||||||
[deprecated("")] class DeprecatedWithBrackets
|
@[deprecated("")] class DeprecatedWithBrackets
|
||||||
[kotlin.deprecated("")] class DeprecatedWithBracketsFQN
|
@[kotlin.deprecated("")] class DeprecatedWithBracketsFQN
|
||||||
[kotlin
|
@[kotlin
|
||||||
./**/deprecated ("")] class DeprecatedWithBracketsFQNSpaces
|
./**/deprecated ("")] class DeprecatedWithBracketsFQNSpaces
|
||||||
|
|
||||||
// Generic
|
// Generic
|
||||||
|
|||||||
@@ -19,16 +19,16 @@ class Class {
|
|||||||
var notNullVar: String = ""
|
var notNullVar: String = ""
|
||||||
|
|
||||||
val notNullValWithGet: String
|
val notNullValWithGet: String
|
||||||
[Nullable] get() = ""
|
@[Nullable] get() = ""
|
||||||
|
|
||||||
var notNullVarWithGetSet: String
|
var notNullVarWithGetSet: String
|
||||||
[Nullable] get() = ""
|
@[Nullable] get() = ""
|
||||||
[Nullable] set(v) {}
|
@[Nullable] set(v) {}
|
||||||
|
|
||||||
val nullableValWithGet: String?
|
val nullableValWithGet: String?
|
||||||
[NotNull] get() = ""
|
@[NotNull] get() = ""
|
||||||
|
|
||||||
var nullableVarWithGetSet: String?
|
var nullableVarWithGetSet: String?
|
||||||
[NotNull] get() = ""
|
@[NotNull] get() = ""
|
||||||
[NotNull] set(v) {}
|
@[NotNull] set(v) {}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// C
|
// C
|
||||||
|
|
||||||
class C {
|
class C {
|
||||||
[kotlin.jvm.jvmOverloads] public fun foo(o: String = "O", s1: String, k: String = "K", s2: String?): String {
|
@[kotlin.jvm.jvmOverloads] public fun foo(o: String = "O", s1: String, k: String = "K", s2: String?): String {
|
||||||
return o + k
|
return o + k
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -18,18 +18,18 @@ val notNullVal: String = ""
|
|||||||
var notNullVar: String = ""
|
var notNullVar: String = ""
|
||||||
|
|
||||||
val notNullValWithGet: String
|
val notNullValWithGet: String
|
||||||
[Nullable] get() = ""
|
@[Nullable] get() = ""
|
||||||
|
|
||||||
var notNullVarWithGetSet: String
|
var notNullVarWithGetSet: String
|
||||||
[Nullable] get() = ""
|
@[Nullable] get() = ""
|
||||||
[Nullable] set(v) {}
|
@[Nullable] set(v) {}
|
||||||
|
|
||||||
val nullableValWithGet: String?
|
val nullableValWithGet: String?
|
||||||
[NotNull] get() = ""
|
@[NotNull] get() = ""
|
||||||
|
|
||||||
var nullableVarWithGetSet: String?
|
var nullableVarWithGetSet: String?
|
||||||
[NotNull] get() = ""
|
@NotNull get() = ""
|
||||||
[NotNull] set(v) {}
|
@NotNull set(v) {}
|
||||||
|
|
||||||
private val privateNn: String = ""
|
private val privateNn: String = ""
|
||||||
private val privateN: String? = ""
|
private val privateN: String? = ""
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ fun box() : String {
|
|||||||
if( 1.(fun Int.(i: Int) = i + this)(1) != 2) return "test 6 failed";
|
if( 1.(fun Int.(i: Int) = i + this)(1) != 2) return "test 6 failed";
|
||||||
if( (fooT1<String>()("mama")) != "mama") return "test 7 failed";
|
if( (fooT1<String>()("mama")) != "mama") return "test 7 failed";
|
||||||
|
|
||||||
val a = [A] fun Int.() = this + 1
|
val a = @A fun Int.() = this + 1
|
||||||
if (1.a() != 2) return "test 8 failed"
|
if (1.a() != 2) return "test 8 failed"
|
||||||
val b = ( fun Int.() = this + 1)
|
val b = ( fun Int.() = this + 1)
|
||||||
if (1.b() != 2) return "test 9 failed"
|
if (1.b() != 2) return "test 9 failed"
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ fun box() : String {
|
|||||||
if( 1.(fun Int.name(i: Int) = i + this)(1) != 2) return "test 6 failed";
|
if( 1.(fun Int.name(i: Int) = i + this)(1) != 2) return "test 6 failed";
|
||||||
if( (fooT1<String>()("mama")) != "mama") return "test 7 failed";
|
if( (fooT1<String>()("mama")) != "mama") return "test 7 failed";
|
||||||
|
|
||||||
val a = [A] fun Int.name() = this + 1 // name
|
val a = @A fun Int.name() = this + 1 // name
|
||||||
if (1.a() != 2) return "test 8 failed"
|
if (1.a() != 2) return "test 8 failed"
|
||||||
val b = ( fun Int.name() = this + 1)
|
val b = ( fun Int.name() = this + 1)
|
||||||
if (1.b() != 2) return "test 9 failed"
|
if (1.b() != 2) return "test 9 failed"
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ package t
|
|||||||
class Reproduce {
|
class Reproduce {
|
||||||
|
|
||||||
fun test(): String {
|
fun test(): String {
|
||||||
[data] class Foo(val bar: String, val baz: Int)
|
@data class Foo(val bar: String, val baz: Int)
|
||||||
val foo = Foo("OK", 5)
|
val foo = Foo("OK", 5)
|
||||||
return foo.bar
|
return foo.bar
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
[Anno] val Int.foo: Int
|
@Anno val Int.foo: Int
|
||||||
get() = this
|
get() = this
|
||||||
|
|
||||||
[Anno] val String.foo: Int
|
@Anno val String.foo: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
|
|
||||||
fun box() = if (42.foo == 42 && "OK".foo == 42) "OK" else "Fail"
|
fun box() = if (42.foo == 42 && "OK".foo == 42) "OK" else "Fail"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ enum class MyEnum {
|
|||||||
K;
|
K;
|
||||||
|
|
||||||
//TODO: KT-4693
|
//TODO: KT-4693
|
||||||
[inline] fun <T> doSmth(a: T) : String {
|
@inline fun <T> doSmth(a: T) : String {
|
||||||
return a.toString() + K.name()
|
return a.toString() + K.name()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class C<T> {
|
class C<T> {
|
||||||
[kotlin.jvm.jvmOverloads] public fun foo(o: T, k: String = "K"): String = o.toString() + k
|
@kotlin.jvm.jvmOverloads public fun foo(o: T, k: String = "K"): String = o.toString() + k
|
||||||
}
|
}
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class C {
|
class C {
|
||||||
[kotlin.jvm.jvmOverloads] public fun foo(o: String = "O", k: String = "K"): String = o + k
|
@kotlin.jvm.jvmOverloads public fun foo(o: String = "O", k: String = "K"): String = o + k
|
||||||
}
|
}
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ Retention(RetentionPolicy.RUNTIME)
|
|||||||
annotation class Second(val value: String)
|
annotation class Second(val value: String)
|
||||||
|
|
||||||
enum class E {
|
enum class E {
|
||||||
[First]
|
@First
|
||||||
E1 {
|
E1 {
|
||||||
fun foo() = "something"
|
fun foo() = "something"
|
||||||
}
|
}
|
||||||
|
|
||||||
[Second("OK")]
|
@Second("OK")
|
||||||
E2
|
E2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ fun testClass(clazz: Class<*>, name: String) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
testClass(foo0([Ann("OK")] { }), "1")
|
testClass(foo0(@Ann("OK") { }), "1")
|
||||||
testClass(foo0( @Ann("OK") { }), "2")
|
testClass(foo0( @Ann("OK") { }), "2")
|
||||||
|
|
||||||
testClass(foo0() @Ann("OK") { }, "3")
|
testClass(foo0() @Ann("OK") { }, "3")
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ annotation class First
|
|||||||
|
|
||||||
class MyClass() {
|
class MyClass() {
|
||||||
public var x: String by Delegate()
|
public var x: String by Delegate()
|
||||||
[First] set
|
@First set
|
||||||
}
|
}
|
||||||
|
|
||||||
class Delegate {
|
class Delegate {
|
||||||
|
|||||||
Vendored
+2
-2
@@ -2,9 +2,9 @@ import kotlin.platform.platformName
|
|||||||
import kotlin.reflect.jvm.*
|
import kotlin.reflect.jvm.*
|
||||||
|
|
||||||
var state: String = "value"
|
var state: String = "value"
|
||||||
[platformName("getter")]
|
@platformName("getter")
|
||||||
get
|
get
|
||||||
[platformName("setter")]
|
@platformName("setter")
|
||||||
set
|
set
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
+9
-9
@@ -1,27 +1,27 @@
|
|||||||
class C {
|
class C {
|
||||||
companion object {
|
companion object {
|
||||||
val defaultGetter: Int = 1
|
val defaultGetter: Int = 1
|
||||||
[native] get
|
@native get
|
||||||
|
|
||||||
var defaultSetter: Int = 1
|
var defaultSetter: Int = 1
|
||||||
[native] get
|
@native get
|
||||||
[native] set
|
@native set
|
||||||
}
|
}
|
||||||
|
|
||||||
val defaultGetter: Int = 1
|
val defaultGetter: Int = 1
|
||||||
[native] get
|
@native get
|
||||||
|
|
||||||
var defaultSetter: Int = 1
|
var defaultSetter: Int = 1
|
||||||
[native] get
|
@native get
|
||||||
[native] set
|
@native set
|
||||||
}
|
}
|
||||||
|
|
||||||
val defaultGetter: Int = 1
|
val defaultGetter: Int = 1
|
||||||
[native] get
|
@native get
|
||||||
|
|
||||||
var defaultSetter: Int = 1
|
var defaultSetter: Int = 1
|
||||||
[native] get
|
@native get
|
||||||
[native] set
|
@native set
|
||||||
|
|
||||||
fun check(body: () -> Unit, signature: String): String? {
|
fun check(body: () -> Unit, signature: String): String? {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class C {
|
class C {
|
||||||
companion object {
|
companion object {
|
||||||
[kotlin.platform.platformStatic] [kotlin.jvm.jvmOverloads] public fun foo(o: String, k: String = "K"): String {
|
@kotlin.platform.platformStatic @kotlin.jvm.jvmOverloads public fun foo(o: String, k: String = "K"): String {
|
||||||
return o + k
|
return o + k
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class C {
|
class C {
|
||||||
[kotlin.jvm.jvmOverloads] public fun foo(o: String = "O", i1: Int, k: String = "K", i2: Int): String {
|
@kotlin.jvm.jvmOverloads public fun foo(o: String = "O", i1: Int, k: String = "K", i2: Int): String {
|
||||||
return o + k
|
return o + k
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class C {
|
class C {
|
||||||
[kotlin.jvm.jvmOverloads] public fun foo(d1: Double, d2: Double, status: String = "OK"): String {
|
@kotlin.jvm.jvmOverloads public fun foo(d1: Double, d2: Double, status: String = "OK"): String {
|
||||||
return if (d1 + d2 == 3.0) status else "fail"
|
return if (d1 + d2 == 3.0) status else "fail"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class C {
|
class C {
|
||||||
}
|
}
|
||||||
|
|
||||||
[kotlin.jvm.jvmOverloads] fun C.foo(o: String, k: String = "K"): String {
|
@kotlin.jvm.jvmOverloads fun C.foo(o: String, k: String = "K"): String {
|
||||||
return o + k
|
return o + k
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
class C {
|
class C {
|
||||||
[kotlin.jvm.jvmOverloads] public fun foo(o: String = "O", k: String = "K"): String {
|
@kotlin.jvm.jvmOverloads public fun foo(o: String = "O", k: String = "K"): String {
|
||||||
return o + k
|
return o + k
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
class C {
|
class C {
|
||||||
[kotlin.jvm.jvmOverloads] public fun foo(o: String, k: String = "K"): String {
|
@kotlin.jvm.jvmOverloads public fun foo(o: String, k: String = "K"): String {
|
||||||
return o + k
|
return o + k
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class C [kotlin.jvm.jvmOverloads] (s1: String, s2: String = "K") {
|
class C @kotlin.jvm.jvmOverloads constructor(s1: String, s2: String = "K") {
|
||||||
public val status: String = s1 + s2
|
public val status: String = s1 + s2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
class C(val i: Int) {
|
class C(val i: Int) {
|
||||||
var status = "fail"
|
var status = "fail"
|
||||||
|
|
||||||
[kotlin.jvm.jvmOverloads] constructor(o: String, k: String = "K"): this(-1) {
|
@kotlin.jvm.jvmOverloads constructor(o: String, k: String = "K"): this(-1) {
|
||||||
status = o + k
|
status = o + k
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class C {
|
class C {
|
||||||
[kotlin.jvm.jvmOverloads] public fun foo(s: String = "OK"): String {
|
@kotlin.jvm.jvmOverloads public fun foo(s: String = "OK"): String {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import kotlin.platform.*
|
import kotlin.platform.*
|
||||||
|
|
||||||
[platformName("bar")]
|
@platformName("bar")
|
||||||
fun foo() = "foo"
|
fun foo() = "foo"
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import kotlin.platform.*
|
|||||||
|
|
||||||
fun <T> List<T>.foo() = "foo"
|
fun <T> List<T>.foo() = "foo"
|
||||||
|
|
||||||
[platformName("fooInt")]
|
@platformName("fooInt")
|
||||||
fun List<Int>.foo() = "fooInt"
|
fun List<Int>.foo() = "fooInt"
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import kotlin.platform.*
|
import kotlin.platform.*
|
||||||
|
|
||||||
[platformName("bar")]
|
@platformName("bar")
|
||||||
fun foo() = "foo"
|
fun foo() = "foo"
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import kotlin.platform.*
|
import kotlin.platform.*
|
||||||
|
|
||||||
var v: Int = 1
|
var v: Int = 1
|
||||||
[platformName("vget")]
|
@platformName("vget")
|
||||||
get
|
get
|
||||||
[platformName("vset")]
|
@platformName("vset")
|
||||||
set
|
set
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ object A {
|
|||||||
platformStatic var a: Int = 1
|
platformStatic var a: Int = 1
|
||||||
|
|
||||||
var b: Int = 1
|
var b: Int = 1
|
||||||
[platformStatic] get
|
@platformStatic get
|
||||||
|
|
||||||
var c: Int = 1
|
var c: Int = 1
|
||||||
[platformStatic] set
|
@platformStatic set
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ object A {
|
|||||||
platformStatic var a: Int = 1
|
platformStatic var a: Int = 1
|
||||||
|
|
||||||
var b: Int = 1
|
var b: Int = 1
|
||||||
[platformStatic] get
|
@platformStatic get
|
||||||
|
|
||||||
var c: Int = 1
|
var c: Int = 1
|
||||||
[platformStatic] set
|
@platformStatic set
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ object A {
|
|||||||
platformStatic var a: Int = 1
|
platformStatic var a: Int = 1
|
||||||
|
|
||||||
var b: Int = 1
|
var b: Int = 1
|
||||||
[platformStatic] get
|
@platformStatic get
|
||||||
|
|
||||||
var c: Int = 1
|
var c: Int = 1
|
||||||
[platformStatic] set
|
@platformStatic set
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ open class B
|
|||||||
class A {
|
class A {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
[platformStatic]
|
@platformStatic
|
||||||
fun <T: B> a(s: T) : T {
|
fun <T: B> a(s: T) : T {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ import java.lang.annotation.*
|
|||||||
Retention(RetentionPolicy.RUNTIME) annotation class SomeAnnotation(val value: String)
|
Retention(RetentionPolicy.RUNTIME) annotation class SomeAnnotation(val value: String)
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
[SomeAnnotation("OK")] val property: Int
|
@SomeAnnotation("OK") val property: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ import java.lang.annotation.*
|
|||||||
Retention(RetentionPolicy.RUNTIME) annotation class SomeAnnotation(val value: String)
|
Retention(RetentionPolicy.RUNTIME) annotation class SomeAnnotation(val value: String)
|
||||||
|
|
||||||
interface T {
|
interface T {
|
||||||
[SomeAnnotation("OK")] val property: Int
|
@SomeAnnotation("OK") val property: Int
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ import java.lang.annotation.*
|
|||||||
|
|
||||||
Retention(RetentionPolicy.RUNTIME) annotation class SomeAnnotation(val value: String)
|
Retention(RetentionPolicy.RUNTIME) annotation class SomeAnnotation(val value: String)
|
||||||
|
|
||||||
[SomeAnnotation("OK")] val property: Int
|
@SomeAnnotation("OK") val property: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
|
|||||||
+1
-1
@@ -2,5 +2,5 @@ package test
|
|||||||
|
|
||||||
import kotlin.platform.*
|
import kotlin.platform.*
|
||||||
|
|
||||||
[platformName("bar")]
|
@platformName("bar")
|
||||||
fun foo() {}
|
fun foo() {}
|
||||||
@@ -3,8 +3,8 @@ package test
|
|||||||
class E1: Exception()
|
class E1: Exception()
|
||||||
class E2: Exception()
|
class E2: Exception()
|
||||||
|
|
||||||
class None [throws()]() {}
|
class None @throws() constructor() {}
|
||||||
class One [throws(E1::class)]()
|
class One @throws(E1::class) constructor()
|
||||||
class Two [throws(E1::class, E2::class)]()
|
class Two @throws(E1::class, E2::class) constructor()
|
||||||
|
|
||||||
class OneWithParam [throws(E1::class)](a: Int)
|
class OneWithParam @throws(E1::class) constructor(a: Int)
|
||||||
@@ -5,7 +5,7 @@ class E1: Exception()
|
|||||||
throws(E1::class) jvmOverloads
|
throws(E1::class) jvmOverloads
|
||||||
fun one(a: Int = 1) {}
|
fun one(a: Int = 1) {}
|
||||||
|
|
||||||
class One [throws(E1::class)] (a: Int = 1) {
|
class One @throws(E1::class) constructor(a: Int = 1) {
|
||||||
throws(E1::class)
|
throws(E1::class)
|
||||||
fun one(a: Int = 1) {}
|
fun one(a: Int = 1) {}
|
||||||
}
|
}
|
||||||
+3
-3
@@ -4,11 +4,11 @@ import kotlin.platform.platformStatic
|
|||||||
|
|
||||||
class A {
|
class A {
|
||||||
companion object {
|
companion object {
|
||||||
[platformStatic] val b: String = "OK"
|
@platformStatic val b: String = "OK"
|
||||||
|
|
||||||
var A.c: String
|
var A.c: String
|
||||||
[platformStatic] get() = "OK"
|
@platformStatic get() = "OK"
|
||||||
[platformStatic] set(t: String) {}
|
@platformStatic set(t: String) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -3,11 +3,11 @@ package test
|
|||||||
import kotlin.platform.platformStatic
|
import kotlin.platform.platformStatic
|
||||||
|
|
||||||
object A {
|
object A {
|
||||||
[platformStatic] val b: String = "OK"
|
@platformStatic val b: String = "OK"
|
||||||
|
|
||||||
var A.c: String
|
var A.c: String
|
||||||
[platformStatic]get() = "OK"
|
@platformStatic get() = "OK"
|
||||||
[platformStatic]set(t: String) {}
|
@platformStatic set(t: String) {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ package test
|
|||||||
import kotlin.platform.*
|
import kotlin.platform.*
|
||||||
|
|
||||||
var v: Int = 1
|
var v: Int = 1
|
||||||
[platformName("vget")]
|
@platformName("vget")
|
||||||
get
|
get
|
||||||
[platformName("vset")]
|
@platformName("vset")
|
||||||
set
|
set
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ public val c: Char = '\u03c0' // pi symbol
|
|||||||
|
|
||||||
public val str: String = ":)"
|
public val str: String = ":)"
|
||||||
|
|
||||||
[Retention(RetentionPolicy.RUNTIME)]
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public annotation class AnnotationClass(public val value: String)
|
public annotation class AnnotationClass(public val value: String)
|
||||||
@@ -2,11 +2,11 @@ package lib
|
|||||||
|
|
||||||
import kotlin.platform.*
|
import kotlin.platform.*
|
||||||
|
|
||||||
[platformName("bar")]
|
@platformName("bar")
|
||||||
fun foo() = "foo"
|
fun foo() = "foo"
|
||||||
|
|
||||||
var v: Int = 1
|
var v: Int = 1
|
||||||
[platformName("vget")]
|
@platformName("vget")
|
||||||
get
|
get
|
||||||
[platformName("vset")]
|
@platformName("vset")
|
||||||
set
|
set
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -DEPRECATED_ANNOTATION_SYNTAX
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
annotation class Ann
|
annotation class Ann
|
||||||
|
|
||||||
fun <T> bar(block: (T) -> Int) {}
|
fun <T> bar(block: (T) -> Int) {}
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
bar<Int> @Ann [Ann] { x -> x }
|
bar<Int> @Ann @[Ann] { x -> x }
|
||||||
bar<Int> @Ann [Ann] label@{ x -> x }
|
bar<Int> @Ann @[Ann] label@{ x -> x }
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
[AnnotatedAnnotation]
|
@[AnnotatedAnnotation]
|
||||||
public annotation class AnnotatedAnnotation
|
public annotation class AnnotatedAnnotation
|
||||||
|
|||||||
Vendored
+1
-1
@@ -4,6 +4,6 @@ annotation class Anno
|
|||||||
|
|
||||||
class Class {
|
class Class {
|
||||||
companion object {
|
companion object {
|
||||||
[Anno] var property: Int = 42
|
@[Anno] var property: Int = 42
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -3,4 +3,4 @@ package test
|
|||||||
|
|
||||||
annotation class Anno(val value: String)
|
annotation class Anno(val value: String)
|
||||||
|
|
||||||
class Constructor [Anno(value = "string")]()
|
class Constructor @Anno(value = "string") constructor()
|
||||||
|
|||||||
+1
-1
@@ -4,5 +4,5 @@ annotation class Anno
|
|||||||
|
|
||||||
class Class {
|
class Class {
|
||||||
val property: Int
|
val property: Int
|
||||||
[Anno] get() = 42
|
@[Anno] get() = 42
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -3,5 +3,5 @@ package test
|
|||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
class Class {
|
class Class {
|
||||||
[Anno] var property: Int = 42
|
@[Anno] var property: Int = 42
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -4,5 +4,5 @@ annotation class Anno
|
|||||||
|
|
||||||
class Class {
|
class Class {
|
||||||
var property: Int = 42
|
var property: Int = 42
|
||||||
[Anno] set(value) { }
|
@[Anno] set(value) { }
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -3,4 +3,4 @@ package test
|
|||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
val property: Int
|
val property: Int
|
||||||
[Anno] get() = 42
|
@[Anno] get() = 42
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ package test
|
|||||||
|
|
||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
[Anno] var property: Int = 42
|
@[Anno] var property: Int = 42
|
||||||
|
|||||||
+1
-1
@@ -3,4 +3,4 @@ package test
|
|||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
var property: Int = 42
|
var property: Int = 42
|
||||||
[Anno] set(value) { }
|
@[Anno] set(value) { }
|
||||||
|
|||||||
+1
-1
@@ -3,4 +3,4 @@ package test
|
|||||||
annotation class A
|
annotation class A
|
||||||
annotation class B
|
annotation class B
|
||||||
|
|
||||||
class Class([A] val x: Int, [B] y: String)
|
class Class(@[A] val x: Int, @[B] y: String)
|
||||||
|
|||||||
+1
-1
@@ -3,4 +3,4 @@ package test
|
|||||||
annotation class A
|
annotation class A
|
||||||
annotation class B
|
annotation class B
|
||||||
|
|
||||||
enum class E([A] val x: String, [B] val y: Int)
|
enum class E(@[A] val x: String, @[B] val y: Int)
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ package test
|
|||||||
|
|
||||||
annotation class A
|
annotation class A
|
||||||
|
|
||||||
fun Int.foo([A] x: Int) {}
|
fun Int.foo(@[A] x: Int) {}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -4,5 +4,5 @@ package test
|
|||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
class Class {
|
class Class {
|
||||||
fun String.foo([Anno] x: Int) = 42
|
fun String.foo(@[Anno] x: Int) = 42
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -5,5 +5,5 @@ annotation class A
|
|||||||
class Class {
|
class Class {
|
||||||
var Int.foo: Int
|
var Int.foo: Int
|
||||||
get() = this
|
get() = this
|
||||||
set([A] value) {}
|
set(@[A] value) {}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -3,5 +3,5 @@ package test
|
|||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
class Class {
|
class Class {
|
||||||
fun foo([Anno] x: String) {}
|
fun foo(@[Anno] x: String) {}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -4,5 +4,5 @@ package test
|
|||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
interface Trait {
|
interface Trait {
|
||||||
fun foo([Anno] x: String) = 42
|
fun foo(@[Anno] x: String) = 42
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@ package test
|
|||||||
annotation class A(val s: String)
|
annotation class A(val s: String)
|
||||||
|
|
||||||
class Outer {
|
class Outer {
|
||||||
class Nested([A("nested")] val x: String)
|
class Nested(@[A("nested")] val x: String)
|
||||||
|
|
||||||
inner class Inner([A("inner")] val y: String)
|
inner class Inner(@[A("inner")] val y: String)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -5,6 +5,6 @@ annotation class B
|
|||||||
annotation class C
|
annotation class C
|
||||||
annotation class D
|
annotation class D
|
||||||
|
|
||||||
fun foo([A B] x: Int, [A C] y: Double, [B C D] z: String) {}
|
fun foo(@[A B] x: Int, @[A C] y: Double, @[B C D] z: String) {}
|
||||||
|
|
||||||
fun bar([A B C D] x: Int) {}
|
fun bar(@[A B C D] x: Int) {}
|
||||||
|
|||||||
+1
-1
@@ -5,5 +5,5 @@ annotation class A
|
|||||||
class Class {
|
class Class {
|
||||||
var foo: Int
|
var foo: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
set([A] value) {}
|
set(@[A] value) {}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ package test
|
|||||||
|
|
||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
fun foo([Anno] x: Int) {}
|
fun foo(@[Anno] x: Int) {}
|
||||||
|
|||||||
+1
-1
@@ -5,4 +5,4 @@ annotation class B
|
|||||||
|
|
||||||
var foo: Int
|
var foo: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
set([A B] value) {}
|
set(@[A B] value) {}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -3,6 +3,6 @@ package test
|
|||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
class Class {
|
class Class {
|
||||||
[Anno] val property: Int
|
@[Anno] val property: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -4,7 +4,7 @@ annotation class Anno
|
|||||||
|
|
||||||
class Class {
|
class Class {
|
||||||
companion object {
|
companion object {
|
||||||
[Anno] val property: Int
|
@[Anno] val property: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -5,12 +5,12 @@ annotation class StringAnno
|
|||||||
annotation class DoubleAnno
|
annotation class DoubleAnno
|
||||||
|
|
||||||
class Class {
|
class Class {
|
||||||
[IntAnno] val Int.extension: Int
|
@[IntAnno] val Int.extension: Int
|
||||||
get() = this
|
get() = this
|
||||||
|
|
||||||
[StringAnno] val String.extension: String
|
@[StringAnno] val String.extension: String
|
||||||
get() = this
|
get() = this
|
||||||
|
|
||||||
[DoubleAnno] val Double.extension: Int
|
@[DoubleAnno] val Double.extension: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -4,11 +4,11 @@ annotation class IntAnno
|
|||||||
annotation class StringAnno
|
annotation class StringAnno
|
||||||
annotation class DoubleAnno
|
annotation class DoubleAnno
|
||||||
|
|
||||||
[IntAnno] val Int.extension: Int
|
@[IntAnno] val Int.extension: Int
|
||||||
get() = this
|
get() = this
|
||||||
|
|
||||||
[StringAnno] val String.extension: String
|
@[StringAnno] val String.extension: String
|
||||||
get() = this
|
get() = this
|
||||||
|
|
||||||
[DoubleAnno] val Double.extension: Int
|
@[DoubleAnno] val Double.extension: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
|
|||||||
Vendored
+1
-1
@@ -4,6 +4,6 @@ annotation class Anno
|
|||||||
|
|
||||||
class Class {
|
class Class {
|
||||||
interface Trait {
|
interface Trait {
|
||||||
[Anno] val property: Int
|
@[Anno] val property: Int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -2,5 +2,5 @@ package test
|
|||||||
|
|
||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
[Anno] val property: Int
|
@[Anno] val property: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
|
|||||||
Vendored
+1
-1
@@ -3,5 +3,5 @@ package test
|
|||||||
annotation class Anno
|
annotation class Anno
|
||||||
|
|
||||||
interface Trait {
|
interface Trait {
|
||||||
[Anno] val property: Int
|
@[Anno] val property: Int
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ annotation class Anno
|
|||||||
|
|
||||||
interface Trait {
|
interface Trait {
|
||||||
companion object {
|
companion object {
|
||||||
[Anno] val property: Int
|
@[Anno] val property: Int
|
||||||
get() = 42
|
get() = 42
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -5,9 +5,9 @@ import org.jetbrains.annotations.*
|
|||||||
public interface LoadIterable<T> {
|
public interface LoadIterable<T> {
|
||||||
Mutable
|
Mutable
|
||||||
public fun getIterable(): MutableIterable<T>?
|
public fun getIterable(): MutableIterable<T>?
|
||||||
public fun setIterable([Mutable] p0: MutableIterable<T>?)
|
public fun setIterable(@Mutable p0: MutableIterable<T>?)
|
||||||
|
|
||||||
ReadOnly
|
ReadOnly
|
||||||
public fun getReadOnlyIterable(): Iterable<T>?
|
public fun getReadOnlyIterable(): Iterable<T>?
|
||||||
public fun setReadOnlyIterable([ReadOnly] p0: Iterable<T>?)
|
public fun setReadOnlyIterable(@ReadOnly p0: Iterable<T>?)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ package test
|
|||||||
import org.jetbrains.annotations.*
|
import org.jetbrains.annotations.*
|
||||||
|
|
||||||
public interface LoadIterableWithConflict<T> {
|
public interface LoadIterableWithConflict<T> {
|
||||||
[ReadOnly] [Mutable]
|
@ReadOnly @Mutable
|
||||||
public fun getIterable(): MutableIterable<T>?
|
public fun getIterable(): MutableIterable<T>?
|
||||||
public fun setIterable([ReadOnly] [Mutable] p0: MutableIterable<T>?)
|
public fun setIterable(@ReadOnly @Mutable p0: MutableIterable<T>?)
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -5,9 +5,9 @@ import org.jetbrains.annotations.*
|
|||||||
public interface LoadIterableWithNullability<T> {
|
public interface LoadIterableWithNullability<T> {
|
||||||
Mutable
|
Mutable
|
||||||
public fun getIterable(): MutableIterable<T>
|
public fun getIterable(): MutableIterable<T>
|
||||||
public fun setIterable([Mutable] p0: MutableIterable<T>)
|
public fun setIterable(@Mutable p0: MutableIterable<T>)
|
||||||
|
|
||||||
ReadOnly
|
ReadOnly
|
||||||
public fun getReadOnlyIterable(): Iterable<T>
|
public fun getReadOnlyIterable(): Iterable<T>
|
||||||
public fun setReadOnlyIterable([ReadOnly] p0: Iterable<T>)
|
public fun setReadOnlyIterable(@ReadOnly p0: Iterable<T>)
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -7,11 +7,11 @@ public interface LoadIterableWithPropagation {
|
|||||||
public interface LoadIterable<T> {
|
public interface LoadIterable<T> {
|
||||||
Mutable
|
Mutable
|
||||||
public fun getIterable(): MutableIterable<T>?
|
public fun getIterable(): MutableIterable<T>?
|
||||||
public fun setIterable([Mutable] p0: MutableIterable<T>?)
|
public fun setIterable(@Mutable p0: MutableIterable<T>?)
|
||||||
|
|
||||||
ReadOnly
|
ReadOnly
|
||||||
public fun getReadOnlyIterable(): Iterable<T>?
|
public fun getReadOnlyIterable(): Iterable<T>?
|
||||||
public fun setReadOnlyIterable([ReadOnly] p0: Iterable<T>?)
|
public fun setReadOnlyIterable(@ReadOnly p0: Iterable<T>?)
|
||||||
}
|
}
|
||||||
|
|
||||||
public open class LoadIterableImpl<T> : LoadIterable<T> {
|
public open class LoadIterableImpl<T> : LoadIterable<T> {
|
||||||
|
|||||||
+5
-5
@@ -4,15 +4,15 @@ import kotlin.platform.*
|
|||||||
|
|
||||||
annotation class A(val s: String)
|
annotation class A(val s: String)
|
||||||
|
|
||||||
[platformName("bar")]
|
@platformName("bar")
|
||||||
A("1")
|
A("1")
|
||||||
fun foo() = "foo"
|
fun foo() = "foo"
|
||||||
|
|
||||||
A("2")
|
A("2")
|
||||||
var v: Int = 1
|
var v: Int = 1
|
||||||
[platformName("vget")]
|
@platformName("vget")
|
||||||
[A("3")]
|
@A("3")
|
||||||
get
|
get
|
||||||
[platformName("vset")]
|
@platformName("vset")
|
||||||
[A("4")]
|
@A("4")
|
||||||
set
|
set
|
||||||
|
|||||||
+3
-3
@@ -3,8 +3,8 @@ package rendererTest
|
|||||||
annotation class TheAnnotation
|
annotation class TheAnnotation
|
||||||
annotation class AnotherAnnotation
|
annotation class AnotherAnnotation
|
||||||
|
|
||||||
[TheAnnotation]
|
@TheAnnotation
|
||||||
public open class TheClass<out T : Int, X> [AnotherAnnotation] () {
|
public open class TheClass<out T : Int, X> @AnotherAnnotation constructor() {
|
||||||
private val privateVal: Int = 5
|
private val privateVal: Int = 5
|
||||||
|
|
||||||
val shouldBeFinal: Int = 5
|
val shouldBeFinal: Int = 5
|
||||||
@@ -14,7 +14,7 @@ public open class TheClass<out T : Int, X> [AnotherAnnotation] () {
|
|||||||
|
|
||||||
protected abstract fun foo() {}
|
protected abstract fun foo() {}
|
||||||
|
|
||||||
[TheAnnotation] private constructor()
|
@TheAnnotation private constructor()
|
||||||
|
|
||||||
private class Inner {}
|
private class Inner {}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -5,18 +5,18 @@ var v4: Function1<Int, String>
|
|||||||
var v4: (() -> Int, (String) -> Unit) -> String
|
var v4: (() -> Int, (String) -> Unit) -> String
|
||||||
var v5: Int.() -> Int
|
var v5: Int.() -> Int
|
||||||
var v6 : Int.(String, Int) -> Unit
|
var v6 : Int.(String, Int) -> Unit
|
||||||
var v7 : [extension] Function2<Int, String, Boolean>
|
var v7 : @extension Function2<Int, String, Boolean>
|
||||||
|
|
||||||
class F: Function0<Unit>
|
class F: Function0<Unit>
|
||||||
var v8: F
|
var v8: F
|
||||||
|
|
||||||
class EF: [extension] Function1<String, Unit>
|
class EF: @extension Function1<String, Unit>
|
||||||
var v9: EF
|
var v9: EF
|
||||||
|
|
||||||
class GF<T>: Function0<T>
|
class GF<T>: Function0<T>
|
||||||
var v10: GF<Any>
|
var v10: GF<Any>
|
||||||
|
|
||||||
class GEF<A, B>: [extension] Function1<A, B>
|
class GEF<A, B>: @extension Function1<A, B>
|
||||||
var v11: GEF<Any, Any>
|
var v11: GEF<Any, Any>
|
||||||
|
|
||||||
//internal var v1: () -> kotlin.Unit defined in root package
|
//internal var v1: () -> kotlin.Unit defined in root package
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
>>> [data] class Person(val name: String)
|
>>> @[data] class Person(val name: String)
|
||||||
>>> var x: String? = "hello"
|
>>> var x: String? = "hello"
|
||||||
>>> val y = x?.let { Person(it) }
|
>>> val y = x?.let { Person(it) }
|
||||||
>>> y
|
>>> y
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ package m
|
|||||||
fun test() {
|
fun test() {
|
||||||
~x~val x = 2
|
~x~val x = 2
|
||||||
|
|
||||||
[`zzz`zzz] fun local(
|
@[`zzz`zzz] fun local(
|
||||||
`zzz`zzz i: Int = `x`x,
|
`zzz`zzz i: Int = `x`x,
|
||||||
j: Int = 3,
|
j: Int = 3,
|
||||||
s: String = "$`x`x",
|
s: String = "$`x`x",
|
||||||
|
|||||||
+13
-13
@@ -1,24 +1,24 @@
|
|||||||
[file: ANNOTATION]
|
@file:ANNOTATION
|
||||||
|
|
||||||
package test
|
package test
|
||||||
|
|
||||||
import test.MyEnum.*
|
import test.MyEnum.*
|
||||||
|
|
||||||
ANNOTATION class MyClass [ANNOTATION]([ANNOTATION] param: Int, [ANNOTATION] val consProp: Int) {
|
ANNOTATION class MyClass @ANNOTATION constructor(@ANNOTATION param: Int, @ANNOTATION val consProp: Int) {
|
||||||
ANNOTATION companion object {
|
ANNOTATION companion object {
|
||||||
}
|
}
|
||||||
|
|
||||||
ANNOTATION var prop: Int = 1
|
ANNOTATION var prop: Int = 1
|
||||||
[ANNOTATION] get
|
@ANNOTATION get
|
||||||
[ANNOTATION] set([ANNOTATION] param) = $prop = param
|
@ANNOTATION set(@ANNOTATION param) = $prop = param
|
||||||
ANNOTATION fun foo([ANNOTATION] param: Int) {
|
ANNOTATION fun foo(@ANNOTATION param: Int) {
|
||||||
[ANNOTATION] class LocalClass { }
|
@ANNOTATION class LocalClass { }
|
||||||
|
|
||||||
[ANNOTATION] object LocalObject { }
|
@ANNOTATION object LocalObject { }
|
||||||
|
|
||||||
[ANNOTATION] fun localFun() {}
|
@ANNOTATION fun localFun() {}
|
||||||
|
|
||||||
[ANNOTATION] var localVar: Int = 1
|
@ANNOTATION var localVar: Int = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
ANNOTATION class InnerClass {
|
ANNOTATION class InnerClass {
|
||||||
@@ -30,13 +30,13 @@ ANNOTATION object MyObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ANNOTATION var topProp: Int = 1
|
ANNOTATION var topProp: Int = 1
|
||||||
[ANNOTATION] get
|
@ANNOTATION get
|
||||||
[ANNOTATION] set([ANNOTATION] param) = $topProp = param
|
@ANNOTATION set(@ANNOTATION param) = $topProp = param
|
||||||
|
|
||||||
ANNOTATION fun topFoo([ANNOTATION] param: Int) {
|
ANNOTATION fun topFoo(@ANNOTATION param: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
val funLiteral = {([ANNOTATION] a: Int) -> a }
|
val funLiteral = {(@ANNOTATION a: Int) -> a }
|
||||||
|
|
||||||
|
|
||||||
annotation class AnnString(a: String)
|
annotation class AnnString(a: String)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ anno("extension property")
|
|||||||
val Double.p2: Double get() = null
|
val Double.p2: Double get() = null
|
||||||
|
|
||||||
anno("top level class")
|
anno("top level class")
|
||||||
class C1 [anno("constructor")] () {
|
class C1 @anno("constructor") constructor() {
|
||||||
anno("member function")
|
anno("member function")
|
||||||
fun f3(anno("member function parameter") p: Int) {}
|
fun f3(anno("member function parameter") p: Int) {}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class A {
|
|||||||
annotation class Ann(val info: String)
|
annotation class Ann(val info: String)
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
[Ann("class")] class Local {
|
@Ann("class") class Local {
|
||||||
Ann("fun") fun foo(): Local = this
|
Ann("fun") fun foo(): Local = this
|
||||||
Ann("val") val x = foo()
|
Ann("val") val x = foo()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class MyClass() {
|
class MyClass() {
|
||||||
val test = ""
|
val test = ""
|
||||||
[deprecated("")] get
|
@deprecated("") get
|
||||||
}
|
}
|
||||||
|
|
||||||
// TESTED_OBJECT_KIND: function
|
// TESTED_OBJECT_KIND: function
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class MyClass() {
|
class MyClass() {
|
||||||
var test = ""
|
var test = ""
|
||||||
[deprecated("")] set
|
@deprecated("") set
|
||||||
}
|
}
|
||||||
|
|
||||||
// TESTED_OBJECT_KIND: function
|
// TESTED_OBJECT_KIND: function
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class MyClass() {
|
class MyClass() {
|
||||||
val test: Int
|
val test: Int
|
||||||
[deprecated("")] get(): Int { return 0 }
|
@deprecated("") get(): Int { return 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class MyClass() {
|
class MyClass() {
|
||||||
var test = 1
|
var test = 1
|
||||||
[deprecated("")] set(i: Int) { test = i }
|
@deprecated("") set(i: Int) { test = i }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPropField() throws Exception {
|
public void testPropField() throws Exception {
|
||||||
ClassLoader loader = loadFileGetClassLoader("[Deprecated] var x = 0");
|
ClassLoader loader = loadFileGetClassLoader("@[Deprecated] var x = 0");
|
||||||
Class<?> packageClass = getPackageClass(loader);
|
Class<?> packageClass = getPackageClass(loader);
|
||||||
assertNull(packageClass.getDeclaredMethod("getX").getAnnotation(Deprecated.class));
|
assertNull(packageClass.getDeclaredMethod("getX").getAnnotation(Deprecated.class));
|
||||||
assertNull(packageClass.getDeclaredMethod("setX", int.class).getAnnotation(Deprecated.class));
|
assertNull(packageClass.getDeclaredMethod("setX", int.class).getAnnotation(Deprecated.class));
|
||||||
@@ -66,7 +66,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
|
|
||||||
public void testPropGetter() throws Exception {
|
public void testPropGetter() throws Exception {
|
||||||
ClassLoader loader = loadFileGetClassLoader("var x = 0\n" +
|
ClassLoader loader = loadFileGetClassLoader("var x = 0\n" +
|
||||||
"[Deprecated] get");
|
"@[Deprecated] get");
|
||||||
Class<?> packageClass = getPackageClass(loader);
|
Class<?> packageClass = getPackageClass(loader);
|
||||||
assertNotNull(packageClass.getDeclaredMethod("getX").getAnnotation(Deprecated.class));
|
assertNotNull(packageClass.getDeclaredMethod("getX").getAnnotation(Deprecated.class));
|
||||||
assertNull(packageClass.getDeclaredMethod("setX", int.class).getAnnotation(Deprecated.class));
|
assertNull(packageClass.getDeclaredMethod("setX", int.class).getAnnotation(Deprecated.class));
|
||||||
@@ -78,7 +78,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
|
|
||||||
public void testPropSetter() throws Exception {
|
public void testPropSetter() throws Exception {
|
||||||
ClassLoader loader = loadFileGetClassLoader("var x = 0\n" +
|
ClassLoader loader = loadFileGetClassLoader("var x = 0\n" +
|
||||||
"[Deprecated] set");
|
"@[Deprecated] set");
|
||||||
Class<?> packageClass = getPackageClass(loader);
|
Class<?> packageClass = getPackageClass(loader);
|
||||||
assertNull(packageClass.getDeclaredMethod("getX").getAnnotation(Deprecated.class));
|
assertNull(packageClass.getDeclaredMethod("getX").getAnnotation(Deprecated.class));
|
||||||
assertNotNull(packageClass.getDeclaredMethod("setX", int.class).getAnnotation(Deprecated.class));
|
assertNotNull(packageClass.getDeclaredMethod("setX", int.class).getAnnotation(Deprecated.class));
|
||||||
@@ -89,7 +89,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testAnnotationForParamInTopLevelFunction() throws Exception {
|
public void testAnnotationForParamInTopLevelFunction() throws Exception {
|
||||||
ClassLoader loader = loadFileGetClassLoader("fun x([Deprecated] i: Int) {}");
|
ClassLoader loader = loadFileGetClassLoader("fun x(@[Deprecated] i: Int) {}");
|
||||||
Class<?> packageClass = getPackageClass(loader);
|
Class<?> packageClass = getPackageClass(loader);
|
||||||
Method packageClassMethod = packageClass.getMethod("x", int.class);
|
Method packageClassMethod = packageClass.getMethod("x", int.class);
|
||||||
assertNotNull(packageClassMethod);
|
assertNotNull(packageClassMethod);
|
||||||
@@ -101,7 +101,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testAnnotationForParamInInstanceFunction() throws NoSuchFieldException, NoSuchMethodException {
|
public void testAnnotationForParamInInstanceFunction() throws NoSuchFieldException, NoSuchMethodException {
|
||||||
loadText("class A() { fun x([Deprecated] i: Int) {}}");
|
loadText("class A() { fun x(@[Deprecated] i: Int) {}}");
|
||||||
Class<?> aClass = generateClass("A");
|
Class<?> aClass = generateClass("A");
|
||||||
Method x = aClass.getMethod("x", int.class);
|
Method x = aClass.getMethod("x", int.class);
|
||||||
assertNotNull(x);
|
assertNotNull(x);
|
||||||
@@ -111,7 +111,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testAnnotationForParamInInstanceExtensionFunction() throws NoSuchFieldException, NoSuchMethodException {
|
public void testAnnotationForParamInInstanceExtensionFunction() throws NoSuchFieldException, NoSuchMethodException {
|
||||||
loadText("class A() { fun String.x([Deprecated] i: Int) {}}");
|
loadText("class A() { fun String.x(@[Deprecated] i: Int) {}}");
|
||||||
Class<?> aClass = generateClass("A");
|
Class<?> aClass = generateClass("A");
|
||||||
Method x = aClass.getMethod("x", String.class, int.class);
|
Method x = aClass.getMethod("x", String.class, int.class);
|
||||||
assertNotNull(x);
|
assertNotNull(x);
|
||||||
@@ -121,7 +121,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testParamInConstructor() throws NoSuchFieldException, NoSuchMethodException {
|
public void testParamInConstructor() throws NoSuchFieldException, NoSuchMethodException {
|
||||||
loadText("class A ([Deprecated] x: Int) {}");
|
loadText("class A (@[Deprecated] 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);
|
||||||
@@ -131,7 +131,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testParamInEnumConstructor() throws NoSuchFieldException, NoSuchMethodException {
|
public void testParamInEnumConstructor() throws NoSuchFieldException, NoSuchMethodException {
|
||||||
loadText("enum class E([Deprecated] p: String)");
|
loadText("enum class E(@[Deprecated] p: String)");
|
||||||
Class<?> klass = generateClass("E");
|
Class<?> klass = generateClass("E");
|
||||||
Constructor constructor = klass.getDeclaredConstructor(String.class, int.class, String.class);
|
Constructor constructor = klass.getDeclaredConstructor(String.class, int.class, String.class);
|
||||||
assertNotNull(constructor);
|
assertNotNull(constructor);
|
||||||
@@ -141,7 +141,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testParamInInnerConstructor() throws NoSuchFieldException, NoSuchMethodException {
|
public void testParamInInnerConstructor() throws NoSuchFieldException, NoSuchMethodException {
|
||||||
loadText("class Outer { inner class Inner([Deprecated] x: Int) }");
|
loadText("class Outer { inner class Inner(@[Deprecated] x: Int) }");
|
||||||
Class<?> outer = generateClass("Outer");
|
Class<?> outer = generateClass("Outer");
|
||||||
Class<?> inner = outer.getDeclaredClasses()[0];
|
Class<?> inner = outer.getDeclaredClasses()[0];
|
||||||
Constructor constructor = inner.getDeclaredConstructor(outer, int.class);
|
Constructor constructor = inner.getDeclaredConstructor(outer, int.class);
|
||||||
@@ -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 (@[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);
|
||||||
@@ -199,7 +199,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testConstructor() throws NoSuchFieldException, NoSuchMethodException {
|
public void testConstructor() throws NoSuchFieldException, NoSuchMethodException {
|
||||||
loadText("class A [Deprecated] () {}");
|
loadText("class A @[Deprecated] () {}");
|
||||||
Class<?> aClass = generateClass("A");
|
Class<?> aClass = generateClass("A");
|
||||||
Constructor x = aClass.getDeclaredConstructor();
|
Constructor x = aClass.getDeclaredConstructor();
|
||||||
Deprecated annotation = (Deprecated) x.getAnnotation(Deprecated.class);
|
Deprecated annotation = (Deprecated) x.getAnnotation(Deprecated.class);
|
||||||
@@ -207,7 +207,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testMethod() throws Exception {
|
public void testMethod() throws Exception {
|
||||||
ClassLoader loader = loadFileGetClassLoader("[Deprecated] fun x () {}");
|
ClassLoader loader = loadFileGetClassLoader("@[Deprecated] fun x () {}");
|
||||||
|
|
||||||
Class<?> packageClass = getPackageClass(loader);
|
Class<?> packageClass = getPackageClass(loader);
|
||||||
Method packageClassMethod = packageClass.getDeclaredMethod("x");
|
Method packageClassMethod = packageClass.getDeclaredMethod("x");
|
||||||
@@ -220,7 +220,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testClass() throws NoSuchFieldException, NoSuchMethodException {
|
public void testClass() throws NoSuchFieldException, NoSuchMethodException {
|
||||||
loadText("[Deprecated] class A () {}");
|
loadText("@[Deprecated] class A () {}");
|
||||||
Class aClass = generateClass("A");
|
Class aClass = generateClass("A");
|
||||||
Deprecated annotation = (Deprecated) aClass.getAnnotation(Deprecated.class);
|
Deprecated annotation = (Deprecated) aClass.getAnnotation(Deprecated.class);
|
||||||
assertNotNull(annotation);
|
assertNotNull(annotation);
|
||||||
|
|||||||
+1
-1
@@ -168,7 +168,7 @@ public abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdi
|
|||||||
private fun addRuntimeRetentionToKotlinSource(text: String): String {
|
private fun addRuntimeRetentionToKotlinSource(text: String): String {
|
||||||
return text.replace(
|
return text.replace(
|
||||||
"annotation class",
|
"annotation class",
|
||||||
"[java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)] annotation class"
|
"@[java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)] annotation class"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
annotation class Hello
|
annotation class Hello
|
||||||
val v = 1
|
val v = 1
|
||||||
|
|
||||||
[<caret>] fun some() {}
|
@[<caret>] fun some() {}
|
||||||
|
|
||||||
// INVOCATION_COUNT: 0
|
// INVOCATION_COUNT: 0
|
||||||
// EXIST: Hello
|
// EXIST: Hello
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
fun foo([inlineOptions] i<caret>) { }
|
fun foo(@inlineOptions i<caret>) { }
|
||||||
|
|
||||||
// INVOCATION_COUNT: 0
|
// INVOCATION_COUNT: 0
|
||||||
// NUMBER: 0
|
// NUMBER: 0
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
annotation class Hello
|
annotation class Hello
|
||||||
val v = 1
|
val v = 1
|
||||||
|
|
||||||
fun foo([<caret>) { }
|
fun foo(@[<caret>) { }
|
||||||
|
|
||||||
// INVOCATION_COUNT: 1
|
// INVOCATION_COUNT: 1
|
||||||
// EXIST: Hello
|
// EXIST: Hello
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
annotation class iHello
|
annotation class iHello
|
||||||
val v = 1
|
val v = 1
|
||||||
|
|
||||||
fun foo([i<caret>) { }
|
fun foo(@[i<caret>) { }
|
||||||
|
|
||||||
// INVOCATION_COUNT: 1
|
// INVOCATION_COUNT: 1
|
||||||
// EXIST: iHello
|
// EXIST: iHello
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
val v = 1
|
val v = 1
|
||||||
|
|
||||||
fun foo([i<caret>) { }
|
fun foo(@[i<caret>) { }
|
||||||
|
|
||||||
// INVOCATION_COUNT: 0
|
// INVOCATION_COUNT: 0
|
||||||
// EXIST: inlineOptions
|
// EXIST: inlineOptions
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
val v = 1
|
val v = 1
|
||||||
|
|
||||||
fun foo([volatile i<caret>) { }
|
fun foo(@[volatile i<caret>) { }
|
||||||
|
|
||||||
// INVOCATION_COUNT: 0
|
// INVOCATION_COUNT: 0
|
||||||
// EXIST: inlineOptions
|
// EXIST: inlineOptions
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
annotation class Hello
|
annotation class Hello
|
||||||
val v = 1
|
val v = 1
|
||||||
|
|
||||||
[<caret>]
|
@[<caret>]
|
||||||
|
|
||||||
// INVOCATION_COUNT: 0
|
// INVOCATION_COUNT: 0
|
||||||
// EXIST: Hello
|
// EXIST: Hello
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user