Files
kotlin-fork/compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesWithConstantsInAnnotation.fir.kt
T
Dmitriy Novozhilov c1575edca4 [FE 1.0] Drop ArrayLiteralsInAnnotations feature
This feature was introduced in 1.2, so now it's stable part of language
  and we can drop support of disabling it
2022-01-14 14:26:50 +03:00

24 lines
453 B
Kotlin
Vendored

const val ONE = 1
annotation class Foo(
val a: IntArray = [ONE],
val b: IntArray = [ONE, 2, 3]
)
val TWO = 2
fun getOne() = ONE
fun getTwo() = TWO
annotation class Bar(
val a: IntArray = [TWO],
val b: IntArray = [1, TWO],
val c: IntArray = [getOne(), getTwo()]
)
annotation class Baz(
val a: IntArray = [null],
val b: IntArray = [1, null, 2],
val c: IntArray = [<!NO_THIS!>this<!>]
)