Small fixes after review: do not set is_pure=true for named constants refactoring

This commit is contained in:
Natalia Ukhorskaya
2013-12-04 17:54:14 +04:00
parent 155cbbfc02
commit 27e602133d
12 changed files with 66 additions and 41 deletions
@@ -5,7 +5,6 @@ Retention(RetentionPolicy.RUNTIME)
annotation class Ann(
val p1: Int,
val p2: Byte,
val p3: Byte,
val p4: Int,
val p5: Int
)
@@ -13,7 +12,6 @@ annotation class Ann(
Ann(
p1 = java.lang.Byte.MAX_VALUE + 1,
p2 = 1 + 1,
p3 = java.lang.Byte.MAX_VALUE - 1,
p4 = 1 + 1,
p5 = 1.toByte() + 1
) class MyClass
@@ -22,7 +20,6 @@ fun box(): String {
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
if (annotation.p1 != 128) return "fail 1, expected = ${128}, actual = ${annotation.p1}"
if (annotation.p2 != 2.toByte()) return "fail 2, expected = ${2}, actual = ${annotation.p2}"
if (annotation.p3 != 126.toByte()) return "fail 3, expected = ${126}, actual = ${annotation.p3}"
if (annotation.p4 != 2) return "fail 4, expected = ${2}, actual = ${annotation.p4}"
if (annotation.p5 != 2) return "fail 5, expected = ${2}, actual = ${annotation.p5}"
return "OK"
@@ -5,7 +5,6 @@ Retention(RetentionPolicy.RUNTIME)
annotation class Ann(
val p1: Int,
val p2: Int,
val p3: Long,
val p4: Long,
val p5: Int
)
@@ -13,7 +12,6 @@ annotation class Ann(
Ann(
p1 = java.lang.Integer.MAX_VALUE + 1,
p2 = 1 + 1,
p3 = java.lang.Integer.MAX_VALUE + 1,
p4 = 1 + 1,
p5 = 1.toInt() + 1.toInt()
) class MyClass
@@ -22,7 +20,6 @@ fun box(): String {
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
if (annotation.p1 != -2147483648) return "fail 1, expected = ${-2147483648}, actual = ${annotation.p1}"
if (annotation.p2 != 2) return "fail 2, expected = ${2}, actual = ${annotation.p2}"
if (annotation.p3 != -2147483648.toLong()) return "fail 3, expected = ${-2147483648}, actual = ${annotation.p3}"
if (annotation.p4 != 2.toLong()) return "fail 4, expected = ${2}, actual = ${annotation.p4}"
if (annotation.p5 != 2) return "fail 5, expected = ${2}, actual = ${annotation.p5}"
return "OK"