Check that arguments of array function call in annotation are constants

#KT-16956 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-03-21 17:37:25 +03:00
parent a2ea518b1a
commit 8466270bdb
8 changed files with 93 additions and 21 deletions
@@ -15,11 +15,11 @@ fun getTwo() = TWO
annotation class Bar(
val a: IntArray = <!ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT!>[TWO]<!>,
val b: IntArray = <!ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT!>[1, TWO]<!>,
val c: IntArray = [getOne(), getTwo()]
val c: IntArray = <!ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT!>[getOne(), getTwo()]<!>
)
annotation class Baz(
val a: IntArray = [<!NULL_FOR_NONNULL_TYPE!>null<!>],
val b: IntArray = [1, <!NULL_FOR_NONNULL_TYPE!>null<!>, 2],
val c: IntArray = [<!NO_THIS!>this<!>]
val c: IntArray = <!ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT!>[<!NO_THIS!>this<!>]<!>
)