Make NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION error

This commit is contained in:
Zalim Bashorov
2015-10-16 15:07:31 +03:00
parent a16658a9e9
commit de5dc61820
33 changed files with 145 additions and 121 deletions
@@ -8,12 +8,12 @@ annotation class Ann(
val p6: Float
)
val prop1: Byte = +1
val prop2: Short = +1
val prop3: Int = +1
val prop4: Long = +1
val prop5: Double = +1.0
val prop6: Float = +1.0.toFloat()
const val prop1: Byte = +1
const val prop2: Short = +1
const val prop3: Int = +1
const val prop4: Long = +1
const val prop5: Double = +1.0
const val prop6: Float = +1.0.toFloat()
@Ann(prop1, prop2, prop3, prop4, prop5, prop6) class MyClass
@@ -26,4 +26,4 @@ fun box(): String {
if (annotation.p5 != prop5) return "fail 5, expected = ${prop5}, actual = ${annotation.p5}"
if (annotation.p6 != prop6) return "fail 6, expected = ${prop6}, actual = ${annotation.p6}"
return "OK"
}
}