Extract common logic for annotation entries collection

Before this change annotation entries starting with '@' within expressions hadn't been resolved

Note that order of annotation entries in result may change according to order of children in PSI (see changed testData)
This commit is contained in:
Denis Zharkov
2015-05-06 15:07:47 +03:00
parent 7d8351abc6
commit c5af4b42b4
10 changed files with 101 additions and 41 deletions
@@ -0,0 +1,14 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
annotation class Ann(val x: Int = 6)
@Ann(1) [Ann(2)] @Ann(3) @private class A [Ann] () {
@Ann(x = 5) fun foo() {
1 + @Ann(1) 1 * @Ann(<!TYPE_MISMATCH!>""<!>) 6
@Ann fun local() {}
}
@Ann val x = 1
fun bar(x: @Ann(1) [Ann(2)] @Ann(3) Int) {}
}
@@ -0,0 +1,19 @@
package
Ann(x = IntegerValueType(1): IntegerValueType(1)) Ann(x = IntegerValueType(2): IntegerValueType(2)) Ann(x = IntegerValueType(3): IntegerValueType(3)) private final class A {
Ann() public constructor A()
Ann() internal final val x: kotlin.Int = 1
internal final fun bar(/*0*/ x: [Ann(x = IntegerValueType(1): IntegerValueType(1)) Ann(x = IntegerValueType(2): IntegerValueType(2)) Ann(x = IntegerValueType(3): IntegerValueType(3))] kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
Ann(x = IntegerValueType(5): IntegerValueType(5)) internal final fun foo(): kotlin.Unit
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
}