Parse some builtin annotations as modifiers
But still resolve them as annotations. Mostly it's needed as begin of migration path, one day they become modifiers anyway Some tests are dropped because they supposed that `annotation` should have parameter
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// FILE: a.kt
|
||||
|
||||
<!NOT_AN_ANNOTATION_CLASS!>annotation<!> class annotation
|
||||
annotation class annotation
|
||||
|
||||
// FILE: test/b.kt
|
||||
|
||||
@@ -22,4 +22,4 @@ annotation class My
|
||||
|
||||
kotlin.annotation.annotation class His
|
||||
|
||||
My class Our
|
||||
My class Our
|
||||
@@ -1,6 +1,6 @@
|
||||
package
|
||||
|
||||
annotation() public final class annotation {
|
||||
kotlin.annotation.annotation() public final class annotation : kotlin.Annotation {
|
||||
public constructor annotation()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package
|
||||
|
||||
kotlin.annotation.annotation() java.lang.Deprecated() public final class my : kotlin.Annotation {
|
||||
java.lang.Deprecated() kotlin.annotation.annotation() public final class my : kotlin.Annotation {
|
||||
public constructor my()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
// Class constructor parameter type CAN be recursively annotated
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class RecursivelyAnnotated(val x: @RecursivelyAnnotated(1) Int)
|
||||
annotation class RecursivelyAnnotated(val x: @RecursivelyAnnotated(1) Int)
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
annotation class B
|
||||
|
||||
class A {
|
||||
<!WRONG_ANNOTATION_TARGET!>annotation<!> companion object {}
|
||||
<!WRONG_MODIFIER_TARGET!>annotation<!> companion object {}
|
||||
}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>annotation<!> object O {}
|
||||
<!WRONG_MODIFIER_TARGET!>annotation<!> object O {}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>annotation<!> interface T {}
|
||||
<!WRONG_MODIFIER_TARGET!>annotation<!> interface T {}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>annotation<!> fun f() = 0
|
||||
<!WRONG_MODIFIER_TARGET!>annotation<!> fun f() = 0
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>annotation<!> val x = 0
|
||||
<!WRONG_MODIFIER_TARGET!>annotation<!> val x = 0
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>annotation<!> var y = 0
|
||||
<!WRONG_MODIFIER_TARGET!>annotation<!> var y = 0
|
||||
@@ -1,16 +0,0 @@
|
||||
// Annotations used for annotations :)
|
||||
enum class Target {
|
||||
CLASSIFIER,
|
||||
FUNCTION
|
||||
}
|
||||
|
||||
<!NOT_AN_ANNOTATION_CLASS!>target(Target.CLASSIFIER)<!>
|
||||
public <!NOT_AN_ANNOTATION_CLASS!>annotation<!> class target(vararg val allowedTargets: Target)
|
||||
|
||||
<!NOT_AN_ANNOTATION_CLASS!>target(Target.CLASSIFIER)<!>
|
||||
public <!NOT_AN_ANNOTATION_CLASS!>annotation(AnnotationRetention.SOURCE)<!> class annotation(
|
||||
val retention: AnnotationRetention = AnnotationRetention.RUNTIME,
|
||||
val repeatable: Boolean = false
|
||||
)
|
||||
|
||||
<!NOT_AN_ANNOTATION_CLASS!>annotation<!> class some
|
||||
@@ -1,44 +0,0 @@
|
||||
package
|
||||
|
||||
public final enum class Target : kotlin.Enum<Target> {
|
||||
enum entry CLASSIFIER
|
||||
|
||||
enum entry FUNCTION
|
||||
|
||||
private constructor Target()
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: Target): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun name(): kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): Target
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<Target>
|
||||
}
|
||||
|
||||
target(allowedTargets = {Target.CLASSIFIER}) annotation(retention = AnnotationRetention.SOURCE) public final class annotation {
|
||||
public constructor annotation(/*0*/ retention: kotlin.annotation.AnnotationRetention = ..., /*1*/ repeatable: kotlin.Boolean = ...)
|
||||
public final val repeatable: kotlin.Boolean
|
||||
public final val retention: kotlin.annotation.AnnotationRetention
|
||||
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
|
||||
}
|
||||
|
||||
annotation() public final class some {
|
||||
public constructor some()
|
||||
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
|
||||
}
|
||||
|
||||
target(allowedTargets = {Target.CLASSIFIER}) annotation() public final class target {
|
||||
public constructor target(/*0*/ vararg allowedTargets: Target /*kotlin.Array<out Target>*/)
|
||||
public final val allowedTargets: kotlin.Array<out Target>
|
||||
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
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
annotation() class emptyBrackets
|
||||
|
||||
emptyBrackets class base
|
||||
@@ -1,15 +0,0 @@
|
||||
package
|
||||
|
||||
emptyBrackets() public final class base {
|
||||
public constructor base()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation() public final class emptyBrackets : kotlin.Annotation {
|
||||
public constructor emptyBrackets()
|
||||
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
|
||||
}
|
||||
+1
-1
@@ -13,4 +13,4 @@ class My(x: Int) {
|
||||
<!WRONG_ANNOTATION_TARGET!>@base<!> <!WRONG_ANNOTATION_TARGET!>@smartget<!> @smartset set
|
||||
|
||||
base <!WRONG_ANNOTATION_TARGET!>smartget<!> <!WRONG_ANNOTATION_TARGET!>smartset<!> fun foo() = y
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -17,4 +17,4 @@ base annotation class derived
|
||||
return local
|
||||
}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
|
||||
+1
-1
@@ -18,4 +18,4 @@ base enum class My <!WRONG_ANNOTATION_TARGET!>@base<!> constructor() {
|
||||
return local
|
||||
}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
|
||||
+1
-1
@@ -17,4 +17,4 @@
|
||||
return local
|
||||
}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
|
||||
@@ -18,4 +18,4 @@
|
||||
return local
|
||||
}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>empty<!> val z = <!WRONG_ANNOTATION_TARGET!>@empty<!> 0
|
||||
<!WRONG_ANNOTATION_TARGET!>empty<!> val z = <!WRONG_ANNOTATION_TARGET!>@empty<!> 0
|
||||
|
||||
@@ -20,4 +20,4 @@ package test
|
||||
|
||||
package test
|
||||
|
||||
common class Correct
|
||||
common class Correct
|
||||
|
||||
+1
-1
@@ -18,4 +18,4 @@
|
||||
return local
|
||||
}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>incorrect<!> val z = <!WRONG_ANNOTATION_TARGET!>@incorrect<!> 0
|
||||
<!WRONG_ANNOTATION_TARGET!>incorrect<!> val z = <!WRONG_ANNOTATION_TARGET!>@incorrect<!> 0
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
return local
|
||||
}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
|
||||
@@ -12,4 +12,4 @@ base class Outer {
|
||||
fun foo() {
|
||||
@base <!WRONG_ANNOTATION_TARGET!>@meta<!> class Local
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -18,4 +18,4 @@
|
||||
return local
|
||||
}
|
||||
|
||||
base val z = 0
|
||||
base val z = 0
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ annotation class typed
|
||||
base class My(val x: <!WRONG_ANNOTATION_TARGET!>@base<!> @typed Int, y: <!WRONG_ANNOTATION_TARGET!>@base<!> @typed Int) {
|
||||
val z: <!WRONG_ANNOTATION_TARGET!>@base<!> @typed Int = y
|
||||
fun foo(): <!WRONG_ANNOTATION_TARGET!>@base<!> @typed Int = z
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
return local
|
||||
}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
annotation class base
|
||||
|
||||
val x: List<@<!DEBUG_INFO_MISSING_UNRESOLVED!>base<!> String>? = null
|
||||
val x: List<@<!DEBUG_INFO_MISSING_UNRESOLVED!>base<!> String>? = null
|
||||
|
||||
+1
-1
@@ -18,4 +18,4 @@
|
||||
return local
|
||||
}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
<!WRONG_ANNOTATION_TARGET!>base<!> val z = 0
|
||||
|
||||
Reference in New Issue
Block a user