[K2] Report NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION when it is appropriate
This commit is contained in:
-16
@@ -1,16 +0,0 @@
|
||||
val nonConst = 1
|
||||
|
||||
const val constConst = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>nonConst * nonConst + 2<!>
|
||||
|
||||
annotation class Ann(val x: Int, val y: String)
|
||||
|
||||
@Ann(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>nonConst<!>, <!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>"${nonConst}"<!>)
|
||||
fun foo1() {}
|
||||
|
||||
@Ann(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>nonConst + constConst<!>, "${constConst}")
|
||||
fun foo2() {}
|
||||
|
||||
annotation class ArrayAnn(val x: IntArray)
|
||||
|
||||
@ArrayAnn(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>intArrayOf(1, constConst, <!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>nonConst<!>)<!>)
|
||||
fun foo3() {}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
val nonConst = 1
|
||||
|
||||
const val constConst = <!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>nonConst * nonConst + 2<!>
|
||||
|
||||
Reference in New Issue
Block a user