Recursive annotations are now possible for properties / functions / classes / primary constructors #EA-66984 Fixed #EA-63992 Fixed #EA-64272 Fixed
A set of tests provided.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
annotation class ann
|
||||
class Annotated(ann val x: Int)
|
||||
@@ -0,0 +1,16 @@
|
||||
package
|
||||
|
||||
internal final class Annotated {
|
||||
public constructor Annotated(/*0*/ ann() x: kotlin.Int)
|
||||
ann() internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final annotation class ann : kotlin.Annotation {
|
||||
public constructor ann()
|
||||
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
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// Functions can be recursively annotated
|
||||
annotation class ann(val x: Int)
|
||||
ann(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>bar()<!>) fun foo() = 1
|
||||
ann(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>foo()<!>) fun bar() = 2
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
ann() internal fun bar(): kotlin.Int
|
||||
ann() internal fun foo(): kotlin.Int
|
||||
|
||||
internal final annotation class ann : kotlin.Annotation {
|
||||
public constructor ann(/*0*/ x: kotlin.Int)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
// Class CAN be recursively annotated
|
||||
RecursivelyAnnotated(1)
|
||||
annotation class RecursivelyAnnotated(val x: Int)
|
||||
@@ -0,0 +1,9 @@
|
||||
package
|
||||
|
||||
RecursivelyAnnotated(x = IntegerValueType(1): IntegerValueType(1)) internal final annotation class RecursivelyAnnotated : kotlin.Annotation {
|
||||
public constructor RecursivelyAnnotated(/*0*/ x: kotlin.Int)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// Function parameter CAN be recursively annotated
|
||||
annotation class ann(val x: Int)
|
||||
fun foo(@ann(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>foo(1)<!>) x: Int): Int = x
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
internal fun foo(/*0*/ ann() x: kotlin.Int): kotlin.Int
|
||||
|
||||
internal final annotation class ann : kotlin.Annotation {
|
||||
public constructor ann(/*0*/ x: kotlin.Int)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// Functions can be recursively annotated
|
||||
annotation class ann(val x: Int)
|
||||
ann(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>foo()<!>) fun foo() = 1
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
ann() internal fun foo(): kotlin.Int
|
||||
|
||||
internal final annotation class ann : kotlin.Annotation {
|
||||
public constructor ann(/*0*/ x: kotlin.Int)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// Properties can be recursively annotated
|
||||
annotation class ann(val x: Int)
|
||||
ann(x) val x: Int = 1
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
ann(x = 1: kotlin.Int) internal val x: kotlin.Int = 1
|
||||
|
||||
internal final annotation class ann : kotlin.Annotation {
|
||||
public constructor ann(/*0*/ x: kotlin.Int)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
// Class constructor parameter CAN be recursively annotated
|
||||
annotation class RecursivelyAnnotated(RecursivelyAnnotated(1) val x: Int)
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package
|
||||
|
||||
internal final annotation class RecursivelyAnnotated : kotlin.Annotation {
|
||||
public constructor RecursivelyAnnotated(/*0*/ RecursivelyAnnotated(x = IntegerValueType(1): IntegerValueType(1)) x: kotlin.Int)
|
||||
RecursivelyAnnotated(x = IntegerValueType(1): IntegerValueType(1)) internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
// Class constructor parameter CAN be recursively annotated
|
||||
annotation class RecursivelyAnnotated(@RecursivelyAnnotated(1) val x: Int)
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package
|
||||
|
||||
internal final annotation class RecursivelyAnnotated : kotlin.Annotation {
|
||||
public constructor RecursivelyAnnotated(/*0*/ RecursivelyAnnotated(x = IntegerValueType(1): IntegerValueType(1)) x: kotlin.Int)
|
||||
RecursivelyAnnotated(x = IntegerValueType(1): IntegerValueType(1)) internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// Properties can be recursively annotated
|
||||
annotation class ann(val x: Int)
|
||||
class My {
|
||||
ann(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>x<!>) val x: Int = 1
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
internal final class My {
|
||||
public constructor My()
|
||||
ann(x = 1: kotlin.Int) internal final val x: kotlin.Int = 1
|
||||
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
|
||||
}
|
||||
|
||||
internal final annotation class ann : kotlin.Annotation {
|
||||
public constructor ann(/*0*/ x: kotlin.Int)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// Class constructor parameter CAN be recursively annotated
|
||||
class RecursivelyAnnotated(<!NOT_AN_ANNOTATION_CLASS!>RecursivelyAnnotated(1)<!> val x: Int)
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package
|
||||
|
||||
internal final class RecursivelyAnnotated {
|
||||
public constructor RecursivelyAnnotated(/*0*/ RecursivelyAnnotated(x = IntegerValueType(1): IntegerValueType(1)) x: kotlin.Int)
|
||||
RecursivelyAnnotated(x = IntegerValueType(1): IntegerValueType(1)) internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// !DIAGNOSTICS: -NO_VALUE_FOR_PARAMETER
|
||||
class Tree<T>(<!NOT_A_CLASS!>T<!> element<!SYNTAX!><!>, <!NOT_AN_ANNOTATION_CLASS!>Tree<T><!> left<!SYNTAX!><!>, <!NOT_AN_ANNOTATION_CLASS!>Tree<T><!> right<!SYNTAX!><!>) {}
|
||||
@@ -0,0 +1,8 @@
|
||||
package
|
||||
|
||||
internal final class Tree</*0*/ T> {
|
||||
public constructor Tree</*0*/ T>(/*0*/ [ERROR : Not an annotation: T]() element: [ERROR : Type annotation was missing for parameter element], /*1*/ Tree<T>() left: [ERROR : Type annotation was missing for parameter left], /*2*/ Tree<T>() right: [ERROR : Type annotation was missing for parameter right])
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun add(a: Int, b: Int) = a + b
|
||||
interface A {
|
||||
fun shuffle<T>(x: List<T>): List<T>
|
||||
fun foo<T>(f : (List<T>) -> List<T>, x : List<T>)
|
||||
|
||||
fun f() : (Int, Int) -> Int = ::add
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
internal fun add(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Int
|
||||
|
||||
internal interface A {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal open fun f(): (kotlin.Int, kotlin.Int) -> kotlin.Int
|
||||
internal abstract fun </*0*/ T> foo(/*0*/ f: (kotlin.List<T>) -> kotlin.List<T>, /*1*/ x: kotlin.List<T>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal abstract fun </*0*/ T> shuffle(/*0*/ x: kotlin.List<T>): kotlin.List<T>
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user