Allow to use collection literals only in annotations

This commit is contained in:
Mikhail Zarechenskiy
2017-03-21 03:11:54 +03:00
parent bfe2ddf7c1
commit a2ea518b1a
7 changed files with 40 additions and 3 deletions
@@ -0,0 +1,15 @@
fun test(): Array<Int> {
<!UNSUPPORTED!>[1, 2]<!>
<!UNSUPPORTED!>[1, 2]<!>[0]
<!UNSUPPORTED!>[1, 2]<!>.get(0)
foo(<!UNSUPPORTED!>[""]<!>)
val <!UNUSED_VARIABLE!>p<!> = <!UNSUPPORTED!>[1, 2]<!> <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>+<!> <!UNSUPPORTED!>[3, 4]<!>
return <!UNSUPPORTED!>[1, 2]<!>
}
fun foo(<!UNUSED_PARAMETER!>a<!>: Array<String> = <!UNSUPPORTED!>[""]<!>) {}
class A(val a: Array<Int> = <!UNSUPPORTED!>[]<!>)