diff --git a/compiler/testData/loadJava/compiledJava/annotations/AnnotationInParam.txt b/compiler/testData/loadJava/compiledJava/annotations/AnnotationInParam.txt index 32db53d2b38..44effe288a5 100644 --- a/compiler/testData/loadJava/compiledJava/annotations/AnnotationInParam.txt +++ b/compiler/testData/loadJava/compiledJava/annotations/AnnotationInParam.txt @@ -2,15 +2,15 @@ package test public trait AnnotationInParam : java.lang.Object { - test.AnnotationInParam.MyAnnotationWithParam(value = MyAnnotation[value = "test"]: test.AnnotationInParam.MyAnnotation) public open class A : java.lang.Object { + test.AnnotationInParam.MyAnnotationWithParam(value = test.AnnotationInParam.MyAnnotation(value = "test": jet.String): test.AnnotationInParam.MyAnnotation) public open class A : java.lang.Object { public constructor A() } - test.AnnotationInParam.MyAnnotationWithParam2(value = MyAnnotation2[value = ["test", "test2"]]: test.AnnotationInParam.MyAnnotation2) public open class B : java.lang.Object { + test.AnnotationInParam.MyAnnotationWithParam2(value = test.AnnotationInParam.MyAnnotation2(value = {"test", "test2"}: jet.Array?): test.AnnotationInParam.MyAnnotation2) public open class B : java.lang.Object { public constructor B() } - test.AnnotationInParam.MyAnnotationWithParam3(value = MyAnnotation3[first = "f", second = "s"]: test.AnnotationInParam.MyAnnotation3) public open class C : java.lang.Object { + test.AnnotationInParam.MyAnnotationWithParam3(value = test.AnnotationInParam.MyAnnotation3(first = "f": jet.String, second = "s": jet.String): test.AnnotationInParam.MyAnnotation3) public open class C : java.lang.Object { public constructor C() } diff --git a/compiler/testData/loadJava/compiledJava/annotations/ArrayOfEnumInParam.txt b/compiler/testData/loadJava/compiledJava/annotations/ArrayOfEnumInParam.txt index f58bec15a75..8b6dc54b433 100644 --- a/compiler/testData/loadJava/compiledJava/annotations/ArrayOfEnumInParam.txt +++ b/compiler/testData/loadJava/compiledJava/annotations/ArrayOfEnumInParam.txt @@ -2,7 +2,7 @@ package test public trait ArrayOfEnumInParam : java.lang.Object { - java.lang.annotation.Target(value = [ElementType.FIELD, ElementType.CONSTRUCTOR]: jet.Array?) public final annotation class targetAnnotation : jet.Annotation { + java.lang.annotation.Target(value = {ElementType.FIELD, ElementType.CONSTRUCTOR}: jet.Array?) public final annotation class targetAnnotation : jet.Annotation { public constructor targetAnnotation(/*0*/ value: jet.String?) public abstract fun value(): jet.String? } diff --git a/compiler/testData/loadJava/compiledJava/annotations/ArrayOfStringInParam.txt b/compiler/testData/loadJava/compiledJava/annotations/ArrayOfStringInParam.txt index b8433667a0e..d50a1f0ac57 100644 --- a/compiler/testData/loadJava/compiledJava/annotations/ArrayOfStringInParam.txt +++ b/compiler/testData/loadJava/compiledJava/annotations/ArrayOfStringInParam.txt @@ -2,7 +2,7 @@ package test public trait ArrayOfStringInParam : java.lang.Object { - test.ArrayOfStringInParam.MyAnnotation(value = ["a", "b", "c"]: jet.Array?) public open class A : java.lang.Object { + test.ArrayOfStringInParam.MyAnnotation(value = {"a", "b", "c"}: jet.Array?) public open class A : java.lang.Object { public constructor A() } diff --git a/compiler/testData/loadJava/compiledJava/annotations/ClassObjectArrayInParam.txt b/compiler/testData/loadJava/compiledJava/annotations/ClassObjectArrayInParam.txt index b472980868b..eba69ed1e98 100644 --- a/compiler/testData/loadJava/compiledJava/annotations/ClassObjectArrayInParam.txt +++ b/compiler/testData/loadJava/compiledJava/annotations/ClassObjectArrayInParam.txt @@ -8,7 +8,7 @@ public open class ClassObjectArrayInParam : java.lang.Object { public abstract fun value(): jet.Array>? } - test.ClassObjectArrayInParam.Anno(value = [ClassObjectArrayInParam?.class, Nested?.class, String?.class]: jet.Array>?) public open class Nested : java.lang.Object { + test.ClassObjectArrayInParam.Anno(value = {test.ClassObjectArrayInParam?.class, test.ClassObjectArrayInParam.Nested?.class, jet.String?.class}: jet.Array>?) public open class Nested : java.lang.Object { public constructor Nested() } } diff --git a/compiler/testData/loadJava/compiledJava/annotations/ClassObjectInParam.txt b/compiler/testData/loadJava/compiledJava/annotations/ClassObjectInParam.txt index 8573aad22b1..a01a7e9f9f6 100644 --- a/compiler/testData/loadJava/compiledJava/annotations/ClassObjectInParam.txt +++ b/compiler/testData/loadJava/compiledJava/annotations/ClassObjectInParam.txt @@ -8,7 +8,7 @@ public open class ClassObjectInParam : java.lang.Object { public abstract fun value(): java.lang.Class? } - test.ClassObjectInParam.Anno(value = ClassObjectInParam?.class: java.lang.Class) public open class Nested : java.lang.Object { + test.ClassObjectInParam.Anno(value = test.ClassObjectInParam?.class: java.lang.Class) public open class Nested : java.lang.Object { public constructor Nested() } } diff --git a/compiler/testData/loadJava/compiledJava/annotations/EmptyArrayInParam.txt b/compiler/testData/loadJava/compiledJava/annotations/EmptyArrayInParam.txt index 97ab7965628..47c6165af2a 100644 --- a/compiler/testData/loadJava/compiledJava/annotations/EmptyArrayInParam.txt +++ b/compiler/testData/loadJava/compiledJava/annotations/EmptyArrayInParam.txt @@ -2,7 +2,7 @@ package test public trait EmptyArrayInParam : java.lang.Object { - test.EmptyArrayInParam.MyAnnotation(value = []: jet.Array?) public open class A : java.lang.Object { + test.EmptyArrayInParam.MyAnnotation(value = {}: jet.Array?) public open class A : java.lang.Object { public constructor A() } diff --git a/compiler/testData/loadJava/compiledJava/annotations/RecursiveAnnotation.txt b/compiler/testData/loadJava/compiledJava/annotations/RecursiveAnnotation.txt index c0fc2419580..a53e5e7d39b 100644 --- a/compiler/testData/loadJava/compiledJava/annotations/RecursiveAnnotation.txt +++ b/compiler/testData/loadJava/compiledJava/annotations/RecursiveAnnotation.txt @@ -2,12 +2,12 @@ package test public trait RecursiveAnnotation : java.lang.Object { - test.RecursiveAnnotation.B(value = A[value = "test"]: test.RecursiveAnnotation.A) public final annotation class A : jet.Annotation { + test.RecursiveAnnotation.B(value = test.RecursiveAnnotation.A(value = "test": jet.String): test.RecursiveAnnotation.A) public final annotation class A : jet.Annotation { public constructor A(/*0*/ value: jet.String?) public abstract fun value(): jet.String? } - test.RecursiveAnnotation.B(value = A[value = "test"]: test.RecursiveAnnotation.A) public final annotation class B : jet.Annotation { + test.RecursiveAnnotation.B(value = test.RecursiveAnnotation.A(value = "test": jet.String): test.RecursiveAnnotation.A) public final annotation class B : jet.Annotation { public constructor B(/*0*/ value: test.RecursiveAnnotation.A?) public abstract fun value(): test.RecursiveAnnotation.A? } diff --git a/compiler/testData/loadJava/compiledJava/annotations/RecursiveAnnotation2.txt b/compiler/testData/loadJava/compiledJava/annotations/RecursiveAnnotation2.txt index b815c3fe7d8..9545547d1f9 100644 --- a/compiler/testData/loadJava/compiledJava/annotations/RecursiveAnnotation2.txt +++ b/compiler/testData/loadJava/compiledJava/annotations/RecursiveAnnotation2.txt @@ -7,7 +7,7 @@ public trait RecursiveAnnotation2 : java.lang.Object { public abstract fun value(): test.RecursiveAnnotation2.B? } - test.RecursiveAnnotation2.A(value = B[value = "test"]: test.RecursiveAnnotation2.B) public final annotation class B : jet.Annotation { + test.RecursiveAnnotation2.A(value = test.RecursiveAnnotation2.B(value = "test": jet.String): test.RecursiveAnnotation2.B) public final annotation class B : jet.Annotation { public constructor B(/*0*/ value: jet.String?) public abstract fun value(): jet.String? } diff --git a/compiler/testData/resolveAnnotations/parameters/byte.kt b/compiler/testData/resolveAnnotations/parameters/byte.kt index 0c74df912d9..755b7113a7d 100644 --- a/compiler/testData/resolveAnnotations/parameters/byte.kt +++ b/compiler/testData/resolveAnnotations/parameters/byte.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1, 1.toByte(), 128.toByte(), 128) class MyClass -// EXPECTED: Ann[b1 = IntegerValueType(1): IntegerValueType(1), b2 = 1.toByte(): jet.Byte, b3 = -128.toByte(): jet.Byte, b4 = IntegerValueType(128): IntegerValueType(128)] \ No newline at end of file +// EXPECTED: Ann(b1 = IntegerValueType(1): IntegerValueType(1), b2 = 1.toByte(): Byte, b3 = -128.toByte(): Byte, b4 = IntegerValueType(128): IntegerValueType(128)) \ No newline at end of file diff --git a/compiler/testData/resolveAnnotations/parameters/char.kt b/compiler/testData/resolveAnnotations/parameters/char.kt index f980e40f7f6..2e3a893118e 100644 --- a/compiler/testData/resolveAnnotations/parameters/char.kt +++ b/compiler/testData/resolveAnnotations/parameters/char.kt @@ -13,4 +13,4 @@ annotation class Ann( Ann('c', 99.toChar(), 'c'.toInt(), 'c'.toLong(), 'c'.toByte(), 'c'.toShort(), 'c'.toDouble(), 'c'.toFloat()) class MyClass -// EXPECTED: Ann[b1 = #99(c): jet.Char, b2 = #99(c): jet.Char, b3 = 99.toInt(): jet.Int, b4 = 99.toLong(): jet.Long, b5 = 99.toByte(): jet.Byte, b6 = 99.toShort(): jet.Short, b7 = 99.0.toDouble(): jet.Double, b8 = 99.0.toFloat(): jet.Float] \ No newline at end of file +// EXPECTED: Ann(b1 = #99(c): Char, b2 = #99(c): Char, b3 = 99.toInt(): Int, b4 = 99.toLong(): Long, b5 = 99.toByte(): Byte, b6 = 99.toShort(): Short, b7 = 99.0.toDouble(): Double, b8 = 99.0.toFloat(): Float) \ No newline at end of file diff --git a/compiler/testData/resolveAnnotations/parameters/double.kt b/compiler/testData/resolveAnnotations/parameters/double.kt index 7f7d88c7c4d..02e7eb31536 100644 --- a/compiler/testData/resolveAnnotations/parameters/double.kt +++ b/compiler/testData/resolveAnnotations/parameters/double.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1.0, 1.toDouble(), 1.7976931348623157E309.toDouble(), 1.7976931348623157E309) class MyClass -// EXPECTED: Ann[b1 = 1.0.toDouble(): jet.Double, b2 = 1.0.toDouble(): jet.Double, b3 = Infinity.toDouble(): jet.Double, b4 = Infinity.toDouble(): jet.Double] \ No newline at end of file +// EXPECTED: Ann(b1 = 1.0.toDouble(): Double, b2 = 1.0.toDouble(): Double, b3 = Infinity.toDouble(): Double, b4 = Infinity.toDouble(): Double) \ No newline at end of file diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/andAnd.kt b/compiler/testData/resolveAnnotations/parameters/expressions/andAnd.kt index e0d9e4784f9..ed845cb7f07 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/andAnd.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/andAnd.kt @@ -7,4 +7,4 @@ annotation class Ann( Ann(true && false, true && true) class MyClass -// EXPECTED: Ann[b1 = false: jet.Boolean, b2 = true: jet.Boolean] +// EXPECTED: Ann(b1 = false: Boolean, b2 = true: Boolean) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/boolean.kt b/compiler/testData/resolveAnnotations/parameters/expressions/boolean.kt index 133b1ec6e18..a8ddb42cc96 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/boolean.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/boolean.kt @@ -8,4 +8,4 @@ annotation class Ann( Ann(true and false, false or true, true xor false) class MyClass -// EXPECTED: Ann[b1 = false: jet.Boolean, b2 = true: jet.Boolean, b3 = true: jet.Boolean] +// EXPECTED: Ann(b1 = false: Boolean, b2 = true: Boolean, b3 = true: Boolean) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/char.kt b/compiler/testData/resolveAnnotations/parameters/expressions/char.kt index c63692a3b94..736f98d16b0 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/char.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/char.kt @@ -4,4 +4,4 @@ annotation class Ann(val c1: Char) Ann('a' - 'a') class MyClass -// EXPECTED: Ann[c1 = IntegerValueType(0): IntegerValueType(0)] +// EXPECTED: Ann(c1 = IntegerValueType(0): IntegerValueType(0)) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/compositeCallBinary.kt b/compiler/testData/resolveAnnotations/parameters/expressions/compositeCallBinary.kt index e801be30e69..7a7eb900ce2 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/compositeCallBinary.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/compositeCallBinary.kt @@ -8,4 +8,4 @@ annotation class Ann( Ann(1.toInt().plus(1), 1.minus(1.toInt()), 1.toInt().times(1.toInt())) class MyClass -// EXPECTED: Ann[p1 = 2.toInt(): jet.Int, p2 = 0.toInt(): jet.Int, p3 = 1.toInt(): jet.Int] +// EXPECTED: Ann(p1 = 2.toInt(): Int, p2 = 0.toInt(): Int, p3 = 1.toInt(): Int) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/divide.kt b/compiler/testData/resolveAnnotations/parameters/expressions/divide.kt index a6e992c89c2..73014a22e5c 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/divide.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/divide.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1 / 1, 1 / 1, 1 / 1, 1 / 1) class MyClass -// EXPECTED: Ann[b = IntegerValueType(1): IntegerValueType(1), i = IntegerValueType(1): IntegerValueType(1), l = IntegerValueType(1): IntegerValueType(1), s = IntegerValueType(1): IntegerValueType(1)] +// EXPECTED: Ann(b = IntegerValueType(1): IntegerValueType(1), i = IntegerValueType(1): IntegerValueType(1), l = IntegerValueType(1): IntegerValueType(1), s = IntegerValueType(1): IntegerValueType(1)) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/double.kt b/compiler/testData/resolveAnnotations/parameters/expressions/double.kt index f07cdf9917a..eb7e77692fb 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/double.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/double.kt @@ -8,4 +8,4 @@ annotation class Ann( Ann(1.0 + 1.0, 1.0 + 1, 1 + 1.0) class MyClass -// EXPECTED: Ann[d1 = 2.0.toDouble(): jet.Double, d2 = 2.0.toDouble(): jet.Double, d3 = 2.0.toDouble(): jet.Double] +// EXPECTED: Ann(d1 = 2.0.toDouble(): Double, d2 = 2.0.toDouble(): Double, d3 = 2.0.toDouble(): Double) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/eqeq.kt b/compiler/testData/resolveAnnotations/parameters/expressions/eqeq.kt index 4160fedeb7d..dc615c55a75 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/eqeq.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/eqeq.kt @@ -10,4 +10,4 @@ annotation class Ann( Ann(1 == 2, 1.0 == 2.0, 'b' == 'a', "a" == "b", "a" == "a") class MyClass -// EXPECTED: Ann[b1 = false: jet.Boolean, b2 = false: jet.Boolean, b3 = false: jet.Boolean, b4 = false: jet.Boolean, b5 = true: jet.Boolean] +// EXPECTED: Ann(b1 = false: Boolean, b2 = false: Boolean, b3 = false: Boolean, b4 = false: Boolean, b5 = true: Boolean) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/escapedString.kt b/compiler/testData/resolveAnnotations/parameters/expressions/escapedString.kt index e4f157754a2..d06a61b0acb 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/escapedString.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/escapedString.kt @@ -4,4 +4,4 @@ annotation class Ann(val s1: String) Ann(s1 = "\$ab") class MyClass -// EXPECTED: Ann[s1 = "$ab": jet.String] +// EXPECTED: Ann(s1 = "$ab": String) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/float.kt b/compiler/testData/resolveAnnotations/parameters/expressions/float.kt index 949239b6ae0..bd84e17c9b6 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/float.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/float.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1.toFloat() + 1.toFloat(), 1.toFloat() + 1, 1.toFloat() + 1.0) class MyClass -// EXPECTED: Ann[d1 = 2.0.toFloat(): jet.Float, d2 = 2.0.toFloat(): jet.Float, d3 = 2.0.toDouble(): jet.Double] +// EXPECTED: Ann(d1 = 2.0.toFloat(): Float, d2 = 2.0.toFloat(): Float, d3 = 2.0.toDouble(): Double) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/gt.kt b/compiler/testData/resolveAnnotations/parameters/expressions/gt.kt index 521da75b769..7f5145d2abb 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/gt.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/gt.kt @@ -14,4 +14,4 @@ val b = 2 Ann(1 > 2, 1.0 > 2.0, 2 > a, b > a, 'b' > 'a', "a" > "b") class MyClass -// EXPECTED: Ann[b1 = false: jet.Boolean, b2 = false: jet.Boolean, b3 = true: jet.Boolean, b4 = true: jet.Boolean, b5 = true: jet.Boolean, b6 = false: jet.Boolean] +// EXPECTED: Ann(b1 = false: Boolean, b2 = false: Boolean, b3 = true: Boolean, b4 = true: Boolean, b5 = true: Boolean, b6 = false: Boolean) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/gteq.kt b/compiler/testData/resolveAnnotations/parameters/expressions/gteq.kt index 51418138882..54dba618a3b 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/gteq.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/gteq.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1 >= 2, 1.0 >= 2.0, 1 >= 1, 1.0 >= 1.0) class MyClass -// EXPECTED: Ann[b1 = false: jet.Boolean, b2 = false: jet.Boolean, b3 = true: jet.Boolean, b4 = true: jet.Boolean] +// EXPECTED: Ann(b1 = false: Boolean, b2 = false: Boolean, b3 = true: Boolean, b4 = true: Boolean) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/infixCallBinary.kt b/compiler/testData/resolveAnnotations/parameters/expressions/infixCallBinary.kt index 4585148ea7f..66ea9e4dd5d 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/infixCallBinary.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/infixCallBinary.kt @@ -10,4 +10,4 @@ annotation class Ann( Ann(1 plus 1, 1 minus 1, 1 times 1, 1 div 1, 1 mod 1) class MyClass -// EXPECTED: Ann[p1 = IntegerValueType(2): IntegerValueType(2), p2 = IntegerValueType(0): IntegerValueType(0), p3 = IntegerValueType(1): IntegerValueType(1), p4 = IntegerValueType(1): IntegerValueType(1), p5 = IntegerValueType(0): IntegerValueType(0)] +// EXPECTED: Ann(p1 = IntegerValueType(2): IntegerValueType(2), p2 = IntegerValueType(0): IntegerValueType(0), p3 = IntegerValueType(1): IntegerValueType(1), p4 = IntegerValueType(1): IntegerValueType(1), p5 = IntegerValueType(0): IntegerValueType(0)) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/intrincics.kt b/compiler/testData/resolveAnnotations/parameters/expressions/intrincics.kt index 97695d58c86..92fc98e9c9c 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/intrincics.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/intrincics.kt @@ -10,4 +10,4 @@ annotation class Ann(p1: Int, Ann(1 or 1, 1 and 1, 1 xor 1, 1 shl 1, 1 shr 1, 1 ushr 1) class MyClass -// EXPECTED: Ann[p1 = IntegerValueType(1): IntegerValueType(1), p2 = IntegerValueType(1): IntegerValueType(1), p3 = IntegerValueType(0): IntegerValueType(0), p4 = IntegerValueType(2): IntegerValueType(2), p5 = IntegerValueType(0): IntegerValueType(0), p6 = IntegerValueType(0): IntegerValueType(0)] +// EXPECTED: Ann(p1 = IntegerValueType(1): IntegerValueType(1), p2 = IntegerValueType(1): IntegerValueType(1), p3 = IntegerValueType(0): IntegerValueType(0), p4 = IntegerValueType(2): IntegerValueType(2), p5 = IntegerValueType(0): IntegerValueType(0), p6 = IntegerValueType(0): IntegerValueType(0)) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/labeled.kt b/compiler/testData/resolveAnnotations/parameters/expressions/labeled.kt index 4909e58ac7a..809e3756236 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/labeled.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/labeled.kt @@ -4,4 +4,4 @@ annotation class Ann(i: Double) Ann(@A 1.0) class MyClass -// EXPECTED: Ann[i = 1.0.toDouble(): jet.Double] +// EXPECTED: Ann(i = 1.0.toDouble(): Double) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/long.kt b/compiler/testData/resolveAnnotations/parameters/expressions/long.kt index 3b9392508e4..453d51fc05c 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/long.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/long.kt @@ -8,4 +8,4 @@ annotation class Ann( Ann(1 + 1, java.lang.Long.MAX_VALUE + 1 - 1, java.lang.Long.MAX_VALUE - 1) class MyClass -// EXPECTED: Ann[l1 = IntegerValueType(2): IntegerValueType(2), l2 = 9223372036854775807.toLong(): jet.Long, l3 = 9223372036854775806.toLong(): jet.Long] +// EXPECTED: Ann(l1 = IntegerValueType(2): IntegerValueType(2), l2 = 9223372036854775807.toLong(): Long, l3 = 9223372036854775806.toLong(): Long) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/lt.kt b/compiler/testData/resolveAnnotations/parameters/expressions/lt.kt index a2320a209f9..456cb634c10 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/lt.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/lt.kt @@ -14,4 +14,4 @@ val b = 2 Ann(1 < 2, 1.0 < 2.0, 2 < a, b < a, 'b' < 'a', "a" < "b") class MyClass -// EXPECTED: Ann[b1 = true: jet.Boolean, b2 = true: jet.Boolean, b3 = false: jet.Boolean, b4 = false: jet.Boolean, b5 = false: jet.Boolean, b6 = true: jet.Boolean] +// EXPECTED: Ann(b1 = true: Boolean, b2 = true: Boolean, b3 = false: Boolean, b4 = false: Boolean, b5 = false: Boolean, b6 = true: Boolean) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/lteq.kt b/compiler/testData/resolveAnnotations/parameters/expressions/lteq.kt index 026f4ce59e8..c109e34e91d 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/lteq.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/lteq.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1 <= 2, 1.0 <= 2.0, 1 <= 1, 1.0 <= 1.0) class MyClass -// EXPECTED: Ann[b1 = true: jet.Boolean, b2 = true: jet.Boolean, b3 = true: jet.Boolean, b4 = true: jet.Boolean] +// EXPECTED: Ann(b1 = true: Boolean, b2 = true: Boolean, b3 = true: Boolean, b4 = true: Boolean) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/maxValue.kt b/compiler/testData/resolveAnnotations/parameters/expressions/maxValue.kt index e543fff1eb3..61b74bb2b88 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/maxValue.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/maxValue.kt @@ -18,4 +18,4 @@ Ann( p6 = java.lang.Long.MAX_VALUE + 1 ) class MyClass -// EXPECTED: Ann[p1 = 128.toInt(): jet.Int, p2 = 32768.toInt(): jet.Int, p3 = -2147483648.toInt(): jet.Int, p4 = -2147483648.toInt(): jet.Int, p5 = 2147483648.toLong(): jet.Long, p6 = -9223372036854775808.toLong(): jet.Long] +// EXPECTED: Ann(p1 = 128.toInt(): Int, p2 = 32768.toInt(): Int, p3 = -2147483648.toInt(): Int, p4 = -2147483648.toInt(): Int, p5 = 2147483648.toLong(): Long, p6 = -9223372036854775808.toLong(): Long) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/maxValueByte.kt b/compiler/testData/resolveAnnotations/parameters/expressions/maxValueByte.kt index aaa4d8b3589..429a82e85d6 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/maxValueByte.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/maxValueByte.kt @@ -16,4 +16,4 @@ Ann( p5 = 1.toByte() + 1.toByte() ) class MyClass -// EXPECTED: Ann[p1 = 128.toInt(): jet.Int, p2 = IntegerValueType(2): IntegerValueType(2), p3 = 128.toInt(): jet.Int, p4 = 2.toInt(): jet.Int, p5 = 2.toInt(): jet.Int] +// EXPECTED: Ann(p1 = 128.toInt(): Int, p2 = IntegerValueType(2): IntegerValueType(2), p3 = 128.toInt(): Int, p4 = 2.toInt(): Int, p5 = 2.toInt(): Int) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/maxValueInt.kt b/compiler/testData/resolveAnnotations/parameters/expressions/maxValueInt.kt index d931465286b..748cffc8dff 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/maxValueInt.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/maxValueInt.kt @@ -16,4 +16,4 @@ Ann( p5 = 1.toInt() + 1.toInt() ) class MyClass -// EXPECTED: Ann[p1 = -2147483648.toInt(): jet.Int, p2 = IntegerValueType(2): IntegerValueType(2), p3 = -2147483648.toInt(): jet.Int, p4 = 2.toInt(): jet.Int, p5 = 2.toInt(): jet.Int] +// EXPECTED: Ann(p1 = -2147483648.toInt(): Int, p2 = IntegerValueType(2): IntegerValueType(2), p3 = -2147483648.toInt(): Int, p4 = 2.toInt(): Int, p5 = 2.toInt(): Int) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/miltiply.kt b/compiler/testData/resolveAnnotations/parameters/expressions/miltiply.kt index 3dcdd4cdfe9..13d5ae39346 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/miltiply.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/miltiply.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1 * 1, 1 * 1, 1 * 1, 1 * 1) class MyClass -// EXPECTED: Ann[b = IntegerValueType(1): IntegerValueType(1), i = IntegerValueType(1): IntegerValueType(1), l = IntegerValueType(1): IntegerValueType(1), s = IntegerValueType(1): IntegerValueType(1)] +// EXPECTED: Ann(b = IntegerValueType(1): IntegerValueType(1), i = IntegerValueType(1): IntegerValueType(1), l = IntegerValueType(1): IntegerValueType(1), s = IntegerValueType(1): IntegerValueType(1)) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/minus.kt b/compiler/testData/resolveAnnotations/parameters/expressions/minus.kt index a65c4133203..d5135263b14 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/minus.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/minus.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1 - 1, 1 - 1, 1 - 1, 1 - 1) class MyClass -// EXPECTED: Ann[b = IntegerValueType(0): IntegerValueType(0), i = IntegerValueType(0): IntegerValueType(0), l = IntegerValueType(0): IntegerValueType(0), s = IntegerValueType(0): IntegerValueType(0)] +// EXPECTED: Ann(b = IntegerValueType(0): IntegerValueType(0), i = IntegerValueType(0): IntegerValueType(0), l = IntegerValueType(0): IntegerValueType(0), s = IntegerValueType(0): IntegerValueType(0)) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/mod.kt b/compiler/testData/resolveAnnotations/parameters/expressions/mod.kt index 148400aeb2d..a62d7fc5db5 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/mod.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/mod.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1 % 1, 1 % 1, 1 % 1, 1 % 1) class MyClass -// EXPECTED: Ann[b = IntegerValueType(0): IntegerValueType(0), i = IntegerValueType(0): IntegerValueType(0), l = IntegerValueType(0): IntegerValueType(0), s = IntegerValueType(0): IntegerValueType(0)] +// EXPECTED: Ann(b = IntegerValueType(0): IntegerValueType(0), i = IntegerValueType(0): IntegerValueType(0), l = IntegerValueType(0): IntegerValueType(0), s = IntegerValueType(0): IntegerValueType(0)) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/multilineString.kt b/compiler/testData/resolveAnnotations/parameters/expressions/multilineString.kt index 55cfad19dea..a02cb75b67f 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/multilineString.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/multilineString.kt @@ -4,4 +4,4 @@ annotation class Ann(val s1: String) Ann(s1 = """a""" + "b") class MyClass -// EXPECTED: Ann[s1 = "ab": jet.String] +// EXPECTED: Ann(s1 = "ab": String) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/not.kt b/compiler/testData/resolveAnnotations/parameters/expressions/not.kt index c99ce6b8bbc..75a992b52ff 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/not.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/not.kt @@ -8,4 +8,4 @@ annotation class Ann( Ann(!true, !false) class MyClass -// EXPECTED: Ann[b1 = false: jet.Boolean, b2 = true: jet.Boolean] +// EXPECTED: Ann(b1 = false: Boolean, b2 = true: Boolean) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/noteq.kt b/compiler/testData/resolveAnnotations/parameters/expressions/noteq.kt index 181c1dd31be..321310cacf2 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/noteq.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/noteq.kt @@ -10,4 +10,4 @@ annotation class Ann( Ann(1 != 2, 1.0 != 2.0, 'b' != 'a', "a" != "b", "a" != "a") class MyClass -// EXPECTED: Ann[b1 = true: jet.Boolean, b2 = true: jet.Boolean, b3 = true: jet.Boolean, b4 = true: jet.Boolean, b5 = false: jet.Boolean] +// EXPECTED: Ann(b1 = true: Boolean, b2 = true: Boolean, b3 = true: Boolean, b4 = true: Boolean, b5 = false: Boolean) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/orOr.kt b/compiler/testData/resolveAnnotations/parameters/expressions/orOr.kt index b779dde101a..b7c96c38d2f 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/orOr.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/orOr.kt @@ -7,4 +7,4 @@ annotation class Ann( Ann(true || false, true || true) class MyClass -// EXPECTED: Ann[b1 = true: jet.Boolean, b2 = true: jet.Boolean] +// EXPECTED: Ann(b1 = true: Boolean, b2 = true: Boolean) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/paranthesized.kt b/compiler/testData/resolveAnnotations/parameters/expressions/paranthesized.kt index b4c3c3714b0..ec1a3ce0d0d 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/paranthesized.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/paranthesized.kt @@ -4,4 +4,4 @@ annotation class Ann(i: Int) Ann((1 + 2) * 2) class MyClass -// EXPECTED: Ann[i = IntegerValueType(6): IntegerValueType(6)] +// EXPECTED: Ann(i = IntegerValueType(6): IntegerValueType(6)) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/plus.kt b/compiler/testData/resolveAnnotations/parameters/expressions/plus.kt index de8e42510be..65e622a16c6 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/plus.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/plus.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1 + 1, 1 + 1, 1 + 1, 1 + 1) class MyClass -// EXPECTED: Ann[b = IntegerValueType(2): IntegerValueType(2), i = IntegerValueType(2): IntegerValueType(2), l = IntegerValueType(2): IntegerValueType(2), s = IntegerValueType(2): IntegerValueType(2)] +// EXPECTED: Ann(b = IntegerValueType(2): IntegerValueType(2), i = IntegerValueType(2): IntegerValueType(2), l = IntegerValueType(2): IntegerValueType(2), s = IntegerValueType(2): IntegerValueType(2)) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/simpleCallBinary.kt b/compiler/testData/resolveAnnotations/parameters/expressions/simpleCallBinary.kt index b8d0f764f76..8a3a75185b4 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/simpleCallBinary.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/simpleCallBinary.kt @@ -10,4 +10,4 @@ annotation class Ann( Ann(1.plus(1), 1.minus(1), 1.times(1), 1.div(1), 1.mod(1)) class MyClass -// EXPECTED: Ann[p1 = IntegerValueType(2): IntegerValueType(2), p2 = IntegerValueType(0): IntegerValueType(0), p3 = IntegerValueType(1): IntegerValueType(1), p4 = IntegerValueType(1): IntegerValueType(1), p5 = IntegerValueType(0): IntegerValueType(0)] +// EXPECTED: Ann(p1 = IntegerValueType(2): IntegerValueType(2), p2 = IntegerValueType(0): IntegerValueType(0), p3 = IntegerValueType(1): IntegerValueType(1), p4 = IntegerValueType(1): IntegerValueType(1), p5 = IntegerValueType(0): IntegerValueType(0)) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/stringPlusInt.kt b/compiler/testData/resolveAnnotations/parameters/expressions/stringPlusInt.kt index 6fb452b858f..828ef3bc52b 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/stringPlusInt.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/stringPlusInt.kt @@ -4,4 +4,4 @@ annotation class Ann(val s1: String) Ann(s1 = "a" + 1) class MyClass -// EXPECTED: Ann[s1 = "a1": jet.String] +// EXPECTED: Ann(s1 = "a1": String) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/stringTemplate.kt b/compiler/testData/resolveAnnotations/parameters/expressions/stringTemplate.kt index fb676e03c7e..23c2a1ff1cf 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/stringTemplate.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/stringTemplate.kt @@ -16,4 +16,4 @@ Ann( s4 = "a${i}a$i" ) class MyClass -// EXPECTED: Ann[s1 = "a1": jet.String, s2 = "a1 b": jet.String, s3 = "1": jet.String, s4 = "a1a1": jet.String] +// EXPECTED: Ann(s1 = "a1": String, s2 = "a1 b": String, s3 = "1": String, s4 = "a1a1": String) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/strings.kt b/compiler/testData/resolveAnnotations/parameters/expressions/strings.kt index 95e069742e8..ed86a25ac31 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/strings.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/strings.kt @@ -6,4 +6,4 @@ val i = 1 Ann(s1 = "a" + "b", s2 = "a" + "a$i") class MyClass -// EXPECTED: Ann[s1 = "ab": jet.String, s2 = "aa1": jet.String] +// EXPECTED: Ann(s1 = "ab": String, s2 = "aa1": String) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/unaryMinus.kt b/compiler/testData/resolveAnnotations/parameters/expressions/unaryMinus.kt index f11b21c32c6..bc820529fca 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/unaryMinus.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/unaryMinus.kt @@ -12,4 +12,4 @@ annotation class Ann( Ann(-1, -1, -1, -1, -1.0, -1.0.toFloat(), -'c') class MyClass -// EXPECTED: Ann[b1 = IntegerValueType(-1): IntegerValueType(-1), b2 = IntegerValueType(-1): IntegerValueType(-1), b3 = IntegerValueType(-1): IntegerValueType(-1), b4 = IntegerValueType(-1): IntegerValueType(-1), b5 = -1.0.toDouble(): jet.Double, b6 = -1.0.toFloat(): jet.Float, b7 = IntegerValueType(-99): IntegerValueType(-99)] +// EXPECTED: Ann(b1 = IntegerValueType(-1): IntegerValueType(-1), b2 = IntegerValueType(-1): IntegerValueType(-1), b3 = IntegerValueType(-1): IntegerValueType(-1), b4 = IntegerValueType(-1): IntegerValueType(-1), b5 = -1.0.toDouble(): Double, b6 = -1.0.toFloat(): Float, b7 = IntegerValueType(-99): IntegerValueType(-99)) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/unaryPlus.kt b/compiler/testData/resolveAnnotations/parameters/expressions/unaryPlus.kt index f6ab53d25f8..f48bf4301f3 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/unaryPlus.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/unaryPlus.kt @@ -12,4 +12,4 @@ annotation class Ann( Ann(+1, +1, +1, +1, +1.0, +1.0.toFloat(), +'c') class MyClass -// EXPECTED: Ann[b1 = IntegerValueType(1): IntegerValueType(1), b2 = IntegerValueType(1): IntegerValueType(1), b3 = IntegerValueType(1): IntegerValueType(1), b4 = IntegerValueType(1): IntegerValueType(1), b5 = 1.0.toDouble(): jet.Double, b6 = 1.0.toFloat(): jet.Float, b7 = IntegerValueType(99): IntegerValueType(99)] +// EXPECTED: Ann(b1 = IntegerValueType(1): IntegerValueType(1), b2 = IntegerValueType(1): IntegerValueType(1), b3 = IntegerValueType(1): IntegerValueType(1), b4 = IntegerValueType(1): IntegerValueType(1), b5 = 1.0.toDouble(): Double, b6 = 1.0.toFloat(): Float, b7 = IntegerValueType(99): IntegerValueType(99)) diff --git a/compiler/testData/resolveAnnotations/parameters/float.kt b/compiler/testData/resolveAnnotations/parameters/float.kt index 3953204eae9..92b0c669c77 100644 --- a/compiler/testData/resolveAnnotations/parameters/float.kt +++ b/compiler/testData/resolveAnnotations/parameters/float.kt @@ -7,4 +7,4 @@ annotation class Ann( Ann(1.toFloat(), 1.0.toFloat()) class MyClass -// EXPECTED: Ann[b1 = 1.0.toFloat(): jet.Float, b2 = 1.0.toFloat(): jet.Float] \ No newline at end of file +// EXPECTED: Ann(b1 = 1.0.toFloat(): Float, b2 = 1.0.toFloat(): Float) \ No newline at end of file diff --git a/compiler/testData/resolveAnnotations/parameters/int.kt b/compiler/testData/resolveAnnotations/parameters/int.kt index f8487c84413..0f5646558c7 100644 --- a/compiler/testData/resolveAnnotations/parameters/int.kt +++ b/compiler/testData/resolveAnnotations/parameters/int.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1, 1.toInt(), 2147483648.toInt(), 2147483648) class MyClass -// EXPECTED: Ann[b1 = IntegerValueType(1): IntegerValueType(1), b2 = 1.toInt(): jet.Int, b3 = -2147483648.toInt(): jet.Int, b4 = IntegerValueType(2147483648): IntegerValueType(2147483648)] \ No newline at end of file +// EXPECTED: Ann(b1 = IntegerValueType(1): IntegerValueType(1), b2 = 1.toInt(): Int, b3 = -2147483648.toInt(): Int, b4 = IntegerValueType(2147483648): IntegerValueType(2147483648)) \ No newline at end of file diff --git a/compiler/testData/resolveAnnotations/parameters/long.kt b/compiler/testData/resolveAnnotations/parameters/long.kt index b83b9504ef8..9d326b8330d 100644 --- a/compiler/testData/resolveAnnotations/parameters/long.kt +++ b/compiler/testData/resolveAnnotations/parameters/long.kt @@ -7,4 +7,4 @@ annotation class Ann( Ann(1, 1.toLong()) class MyClass -// EXPECTED: Ann[b1 = IntegerValueType(1): IntegerValueType(1), b2 = 1.toLong(): jet.Long] \ No newline at end of file +// EXPECTED: Ann(b1 = IntegerValueType(1): IntegerValueType(1), b2 = 1.toLong(): Long) \ No newline at end of file diff --git a/compiler/testData/resolveAnnotations/parameters/short.kt b/compiler/testData/resolveAnnotations/parameters/short.kt index 50437360117..91d52204981 100644 --- a/compiler/testData/resolveAnnotations/parameters/short.kt +++ b/compiler/testData/resolveAnnotations/parameters/short.kt @@ -9,4 +9,4 @@ annotation class Ann( Ann(1, 1.toShort(), 32768.toShort(), 32768) class MyClass -// EXPECTED: Ann[b1 = IntegerValueType(1): IntegerValueType(1), b2 = 1.toShort(): jet.Short, b3 = -32768.toShort(): jet.Short, b4 = IntegerValueType(32768): IntegerValueType(32768)] \ No newline at end of file +// EXPECTED: Ann(b1 = IntegerValueType(1): IntegerValueType(1), b2 = 1.toShort(): Short, b3 = -32768.toShort(): Short, b4 = IntegerValueType(32768): IntegerValueType(32768)) \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/resolve/annotation/AbstractAnnotationDescriptorResolveTest.java b/compiler/tests/org/jetbrains/jet/resolve/annotation/AbstractAnnotationDescriptorResolveTest.java index eafabfee9c6..78290a0f8d6 100644 --- a/compiler/tests/org/jetbrains/jet/resolve/annotation/AbstractAnnotationDescriptorResolveTest.java +++ b/compiler/tests/org/jetbrains/jet/resolve/annotation/AbstractAnnotationDescriptorResolveTest.java @@ -29,12 +29,12 @@ import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; import org.jetbrains.jet.lang.descriptors.impl.AnonymousFunctionDescriptor; import org.jetbrains.jet.lang.psi.JetFile; import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.resolve.name.Name; import org.jetbrains.jet.lang.resolve.scopes.JetScope; import org.jetbrains.jet.lang.types.TypeProjection; import org.jetbrains.jet.renderer.DescriptorRenderer; +import org.jetbrains.jet.renderer.DescriptorRendererBuilder; import java.io.File; import java.io.IOException; @@ -43,6 +43,11 @@ import java.util.Collections; import java.util.List; public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFixture { + private static final DescriptorRenderer WITH_ANNOTATION_ARGUMENT_TYPES = new DescriptorRendererBuilder() + .setVerbose(true) + .setShortNames(true) + .build(); + private static final String PATH = "compiler/testData/resolveAnnotations/testFile.kt"; private static final FqName PACKAGE = new FqName("test"); @@ -277,7 +282,7 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFix String actual = StringUtil.join(member.getAnnotations(), new Function() { @Override public String fun(AnnotationDescriptor annotationDescriptor) { - return annotationDescriptor.getType().toString() + DescriptorUtils.getSortedValueArguments(annotationDescriptor, DescriptorRenderer.TEXT); + return WITH_ANNOTATION_ARGUMENT_TYPES.renderAnnotation(annotationDescriptor); } }, " "); assertEquals("Failed to resolve annotation descriptor for " + member.toString(), expectedAnnotation, actual); @@ -288,7 +293,7 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFix return StringUtil.join(member.getAnnotations(), new Function() { @Override public String fun(AnnotationDescriptor annotationDescriptor) { - return annotationDescriptor.getType().toString() + DescriptorUtils.getSortedValueArguments(annotationDescriptor, DescriptorRenderer.TEXT); + return WITH_ANNOTATION_ARGUMENT_TYPES.renderAnnotation(annotationDescriptor); } }, " "); } diff --git a/compiler/tests/org/jetbrains/jet/resolve/annotation/AnnotationDescriptorResolveTest.java b/compiler/tests/org/jetbrains/jet/resolve/annotation/AnnotationDescriptorResolveTest.java index a3c00fbad27..fb32bab8081 100644 --- a/compiler/tests/org/jetbrains/jet/resolve/annotation/AnnotationDescriptorResolveTest.java +++ b/compiler/tests/org/jetbrains/jet/resolve/annotation/AnnotationDescriptorResolveTest.java @@ -21,73 +21,73 @@ import java.io.IOException; public class AnnotationDescriptorResolveTest extends AbstractAnnotationDescriptorResolveTest { public void testIntAnnotation() throws IOException { String content = getContent("AnnInt(1)"); - String expectedAnnotation = "AnnInt[a = IntegerValueType(1): IntegerValueType(1)]"; + String expectedAnnotation = "AnnInt(a = IntegerValueType(1): IntegerValueType(1))"; doTest(content, expectedAnnotation); } public void testStringAnnotation() throws IOException { String content = getContent("AnnString(\"test\")"); - String expectedAnnotation = "AnnString[a = \"test\": jet.String]"; + String expectedAnnotation = "AnnString(a = \"test\": String)"; doTest(content, expectedAnnotation); } public void testEnumAnnotation() throws IOException { String content = getContent("AnnEnum(MyEnum.A)"); - String expectedAnnotation = "AnnEnum[a = MyEnum.A: test.MyEnum]"; + String expectedAnnotation = "AnnEnum(a = MyEnum.A: MyEnum)"; doTest(content, expectedAnnotation); } public void testQualifiedEnumAnnotation() throws IOException { - String content = getContent("AnnEnum(test.MyEnum.A)"); - String expectedAnnotation = "AnnEnum[a = MyEnum.A: test.MyEnum]"; + String content = getContent("AnnEnum(MyEnum.A)"); + String expectedAnnotation = "AnnEnum(a = MyEnum.A: MyEnum)"; doTest(content, expectedAnnotation); } public void testUnqualifiedEnumAnnotation() throws IOException { String content = getContent("AnnEnum(A)"); - String expectedAnnotation = "AnnEnum[a = MyEnum.A: test.MyEnum]"; + String expectedAnnotation = "AnnEnum(a = MyEnum.A: MyEnum)"; doTest(content, expectedAnnotation); } public void testIntArrayAnnotation() throws IOException { String content = getContent("AnnIntArray(intArray(1, 2))"); - String expectedAnnotation = "AnnIntArray[a = [IntegerValueType(1), IntegerValueType(2)]: jet.IntArray]"; + String expectedAnnotation = "AnnIntArray(a = {IntegerValueType(1), IntegerValueType(2)}: IntArray)"; doTest(content, expectedAnnotation); } public void testIntArrayVarargAnnotation() throws IOException { String content = getContent("AnnIntVararg(1, 2)"); - String expectedAnnotation = "AnnIntVararg[a = [IntegerValueType(1), IntegerValueType(2)]: jet.IntArray]"; + String expectedAnnotation = "AnnIntVararg(a = {IntegerValueType(1), IntegerValueType(2)}: IntArray)"; doTest(content, expectedAnnotation); } public void testStringArrayVarargAnnotation() throws IOException { String content = getContent("AnnStringVararg(\"a\", \"b\")"); - String expectedAnnotation = "AnnStringVararg[a = [\"a\", \"b\"]: jet.Array]"; + String expectedAnnotation = "AnnStringVararg(a = {\"a\", \"b\"}: Array)"; doTest(content, expectedAnnotation); } public void testStringArrayAnnotation() throws IOException { String content = getContent("AnnStringArray(array(\"a\"))"); - String expectedAnnotation = "AnnStringArray[a = [\"a\"]: jet.Array]"; + String expectedAnnotation = "AnnStringArray(a = {\"a\"}: Array)"; doTest(content, expectedAnnotation); } public void testEnumArrayAnnotation() throws IOException { String content = getContent("AnnArrayOfEnum(array(MyEnum.A))"); - String expectedAnnotation = "AnnArrayOfEnum[a = [MyEnum.A]: jet.Array]"; + String expectedAnnotation = "AnnArrayOfEnum(a = {MyEnum.A}: Array)"; doTest(content, expectedAnnotation); } public void testAnnotationAnnotation() throws Exception { String content = getContent("AnnAnn(AnnInt(1))"); - String expectedAnnotation = "AnnAnn[a = AnnInt[a = IntegerValueType(1)]: test.AnnInt]"; + String expectedAnnotation = "AnnAnn(a = AnnInt(a = IntegerValueType(1): IntegerValueType(1)): AnnInt)"; doTest(content, expectedAnnotation); } public void testJavaClassAnnotation() throws Exception { String content = getContent("AnnClass(javaClass())"); - String expectedAnnotation = "AnnClass[a = MyClass.class: java.lang.Class]"; + String expectedAnnotation = "AnnClass(a = MyClass.class: Class)"; doTest(content, expectedAnnotation); } } diff --git a/core/descriptors/src/org/jetbrains/jet/lang/descriptors/annotations/AnnotationDescriptorImpl.java b/core/descriptors/src/org/jetbrains/jet/lang/descriptors/annotations/AnnotationDescriptorImpl.java index ebd21648bce..fb584349022 100644 --- a/core/descriptors/src/org/jetbrains/jet/lang/descriptors/annotations/AnnotationDescriptorImpl.java +++ b/core/descriptors/src/org/jetbrains/jet/lang/descriptors/annotations/AnnotationDescriptorImpl.java @@ -20,9 +20,9 @@ import com.google.common.collect.Maps; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor; -import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; import org.jetbrains.jet.lang.types.JetType; +import org.jetbrains.jet.renderer.DescriptorRenderer; import java.util.Collections; import java.util.Map; @@ -59,6 +59,6 @@ public class AnnotationDescriptorImpl implements AnnotationDescriptor { @Override public String toString() { - return annotationType.toString() + DescriptorUtils.getSortedValueArguments(this, null); + return DescriptorRenderer.TEXT.renderAnnotation(this); } } diff --git a/core/descriptors/src/org/jetbrains/jet/lang/descriptors/annotations/DefaultAnnotationArgumentVisitor.java b/core/descriptors/src/org/jetbrains/jet/lang/descriptors/annotations/DefaultAnnotationArgumentVisitor.java new file mode 100644 index 00000000000..51941f8a909 --- /dev/null +++ b/core/descriptors/src/org/jetbrains/jet/lang/descriptors/annotations/DefaultAnnotationArgumentVisitor.java @@ -0,0 +1,105 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.lang.descriptors.annotations; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jet.lang.resolve.constants.*; +import org.jetbrains.jet.lang.resolve.constants.StringValue; + +public abstract class DefaultAnnotationArgumentVisitor implements AnnotationArgumentVisitor { + public abstract R visitValue(@NotNull CompileTimeConstant value, D data); + + @Override + public R visitLongValue(@NotNull LongValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitIntValue(IntValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitShortValue(ShortValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitByteValue(ByteValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitDoubleValue(DoubleValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitFloatValue(FloatValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitBooleanValue(BooleanValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitCharValue(CharValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitStringValue(StringValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitNullValue(NullValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitErrorValue(ErrorValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitEnumValue(EnumValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitArrayValue(ArrayValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitAnnotationValue(AnnotationValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitJavaClassValue(JavaClassValue value, D data) { + return visitValue(value, data); + } + + @Override + public R visitNumberTypeValue(IntegerValueTypeConstant value, D data) { + return visitValue(value, data); + } +} diff --git a/core/descriptors/src/org/jetbrains/jet/lang/resolve/DescriptorUtils.java b/core/descriptors/src/org/jetbrains/jet/lang/resolve/DescriptorUtils.java index f9b570352e2..9d7acddaf60 100644 --- a/core/descriptors/src/org/jetbrains/jet/lang/resolve/DescriptorUtils.java +++ b/core/descriptors/src/org/jetbrains/jet/lang/resolve/DescriptorUtils.java @@ -23,9 +23,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; import org.jetbrains.jet.lang.descriptors.*; -import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; import org.jetbrains.jet.lang.descriptors.impl.AnonymousFunctionDescriptor; -import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe; import org.jetbrains.jet.lang.resolve.name.Name; @@ -35,9 +33,11 @@ import org.jetbrains.jet.lang.resolve.scopes.JetScope; import org.jetbrains.jet.lang.types.*; import org.jetbrains.jet.lang.types.checker.JetTypeChecker; import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; -import org.jetbrains.jet.renderer.DescriptorRenderer; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Set; import static org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor.NO_RECEIVER_PARAMETER; @@ -345,23 +345,6 @@ public class DescriptorUtils { return Visibilities.PUBLIC; } - @NotNull - public static List getSortedValueArguments( - @NotNull AnnotationDescriptor descriptor, - @Nullable DescriptorRenderer rendererForTypesIfNecessary - ) { - List resultList = Lists.newArrayList(); - for (Map.Entry> entry : descriptor.getAllValueArguments().entrySet()) { - CompileTimeConstant value = entry.getValue(); - String typeSuffix = rendererForTypesIfNecessary == null - ? "" - : ": " + rendererForTypesIfNecessary.renderType(value.getType(KotlinBuiltIns.getInstance())); - resultList.add(entry.getKey().getName().asString() + " = " + value.toString() + typeSuffix); - } - Collections.sort(resultList); - return resultList; - } - @Nullable public static ClassDescriptor getInnerClassByName(@NotNull ClassDescriptor classDescriptor, @NotNull String innerClassName) { ClassifierDescriptor classifier = classDescriptor.getDefaultType().getMemberScope().getClassifier(Name.identifier(innerClassName)); diff --git a/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/AnnotationValue.java b/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/AnnotationValue.java index 8e23712657f..1cc7816657b 100644 --- a/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/AnnotationValue.java +++ b/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/AnnotationValue.java @@ -28,6 +28,14 @@ public class AnnotationValue extends CompileTimeConstant { super(value); } + @NotNull + @Override + public AnnotationDescriptor getValue() { + AnnotationDescriptor value = super.getValue(); + assert value != null : "Guaranteed by constructor"; + return value; + } + @Override @NotNull public JetType getType(@NotNull KotlinBuiltIns kotlinBuiltIns) { diff --git a/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/ArrayValue.java b/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/ArrayValue.java index e3385923f68..4b11d075878 100644 --- a/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/ArrayValue.java +++ b/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/ArrayValue.java @@ -17,7 +17,6 @@ package org.jetbrains.jet.lang.resolve.constants; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.annotations.AnnotationArgumentVisitor; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; @@ -33,6 +32,14 @@ public class ArrayValue extends CompileTimeConstant> this.type = type; } + @NotNull + @Override + public List> getValue() { + List> value = super.getValue(); + assert value != null : "Guaranteed by constructor"; + return value; + } + @NotNull @Override public JetType getType(@NotNull KotlinBuiltIns kotlinBuiltIns) { diff --git a/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/JavaClassValue.java b/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/JavaClassValue.java index 4b4e99163e1..19851592b86 100644 --- a/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/JavaClassValue.java +++ b/core/descriptors/src/org/jetbrains/jet/lang/resolve/constants/JavaClassValue.java @@ -27,6 +27,7 @@ public class JavaClassValue extends CompileTimeConstant { super(value); } + @NotNull @Override public JetType getValue() { return value.getArguments().iterator().next().getType(); diff --git a/core/descriptors/src/org/jetbrains/jet/renderer/DescriptorRenderer.java b/core/descriptors/src/org/jetbrains/jet/renderer/DescriptorRenderer.java index 34d41931280..9b508c6fdda 100644 --- a/core/descriptors/src/org/jetbrains/jet/renderer/DescriptorRenderer.java +++ b/core/descriptors/src/org/jetbrains/jet/renderer/DescriptorRenderer.java @@ -20,6 +20,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor; +import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lang.types.TypeProjection; @@ -67,6 +68,9 @@ public interface DescriptorRenderer extends Renderer { @NotNull String renderTypeArguments(@NotNull List typeArguments); + @NotNull + String renderAnnotation(@NotNull AnnotationDescriptor annotation); + @NotNull @Override String render(@NotNull DeclarationDescriptor declarationDescriptor); diff --git a/core/descriptors/src/org/jetbrains/jet/renderer/DescriptorRendererImpl.java b/core/descriptors/src/org/jetbrains/jet/renderer/DescriptorRendererImpl.java index a54b2b50d03..a0ef3f07dd3 100644 --- a/core/descriptors/src/org/jetbrains/jet/renderer/DescriptorRendererImpl.java +++ b/core/descriptors/src/org/jetbrains/jet/renderer/DescriptorRendererImpl.java @@ -19,12 +19,15 @@ package org.jetbrains.jet.renderer; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.intellij.openapi.util.text.StringUtil; +import com.intellij.util.Function; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.descriptors.*; import org.jetbrains.jet.lang.descriptors.annotations.Annotated; import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; +import org.jetbrains.jet.lang.descriptors.annotations.DefaultAnnotationArgumentVisitor; import org.jetbrains.jet.lang.descriptors.impl.DeclarationDescriptorVisitorEmptyBodies; import org.jetbrains.jet.lang.resolve.DescriptorUtils; +import org.jetbrains.jet.lang.resolve.constants.*; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.resolve.name.FqNameBase; import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe; @@ -34,9 +37,7 @@ import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; import java.util.*; -import static org.jetbrains.jet.lang.types.TypeUtils.CANT_INFER_LAMBDA_PARAM_TYPE; -import static org.jetbrains.jet.lang.types.TypeUtils.CANT_INFER_TYPE_PARAMETER; -import static org.jetbrains.jet.lang.types.TypeUtils.DONT_CARE; +import static org.jetbrains.jet.lang.types.TypeUtils.*; public class DescriptorRendererImpl implements DescriptorRenderer { private final boolean shortNames; @@ -90,7 +91,6 @@ public class DescriptorRendererImpl implements DescriptorRenderer { this.excludedAnnotationClasses = Sets.newHashSet(excludedAnnotationClasses); } - /* FORMATTING */ @NotNull private String renderKeyword(@NotNull String keyword) { @@ -317,15 +317,72 @@ public class DescriptorRendererImpl implements DescriptorRenderer { assert annotationClass != null; if (!excludedAnnotationClasses.contains(DescriptorUtils.getFqNameSafe(annotationClass))) { - builder.append(renderType(annotation.getType())); - if (verbose) { - builder.append("(").append(StringUtil.join(DescriptorUtils.getSortedValueArguments(annotation, this), ", ")).append(")"); - } - builder.append(" "); + builder.append(renderAnnotation(annotation)).append(" "); } } } + @Override + @NotNull + public String renderAnnotation(@NotNull AnnotationDescriptor annotation) { + StringBuilder sb = new StringBuilder(); + sb.append(renderType(annotation.getType())); + if (verbose) { + sb.append("(").append(StringUtil.join(renderAndSortAnnotationArguments(annotation), ", ")).append(")"); + } + return sb.toString(); + } + + @NotNull + private List renderAndSortAnnotationArguments(@NotNull AnnotationDescriptor descriptor) { + List resultList = Lists.newArrayList(); + for (Map.Entry> entry : descriptor.getAllValueArguments().entrySet()) { + CompileTimeConstant value = entry.getValue(); + String typeSuffix = ": " + renderType(value.getType(KotlinBuiltIns.getInstance())); + resultList.add(entry.getKey().getName().asString() + " = " + renderConstant(value) + typeSuffix); + } + Collections.sort(resultList); + return resultList; + } + + @NotNull + private String renderConstant(@NotNull CompileTimeConstant value) { + return value.accept( + new DefaultAnnotationArgumentVisitor() { + @Override + public String visitValue(@NotNull CompileTimeConstant value, Void data) { + return value.toString(); + } + + @Override + public String visitArrayValue(ArrayValue value, Void data) { + return "{" + + StringUtil.join( + value.getValue(), + new Function, String>() { + @Override + public String fun(CompileTimeConstant constant) { + return renderConstant(constant); + } + }, + ", ") + + "}"; + } + + @Override + public String visitAnnotationValue(AnnotationValue value, Void data) { + return renderAnnotation(value.getValue()); + } + + @Override + public String visitJavaClassValue(JavaClassValue value, Void data) { + return renderType(value.getValue()) + ".class"; + } + }, + null + ); + } + private void renderVisibility(@NotNull Visibility visibility, @NotNull StringBuilder builder) { if (!modifiers.contains(Modifier.VISIBILITY)) return; if (normalizedVisibilities) {