[FIR] Report UNSUPPORTED on array literals not from annotation classes ^KT-50750 Fixed

This commit is contained in:
Ivan Kochurkin
2022-02-09 17:14:23 +03:00
committed by teamcity
parent 19285d0569
commit 73b45a1254
12 changed files with 139 additions and 94 deletions
@@ -1,21 +0,0 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
fun takeArray(array: Array<String>) {}
fun test() {
"foo bar".<!UNRESOLVED_REFERENCE!>split<!>([""])
<!UNRESOLVED_REFERENCE!>unresolved<!>([""])
takeArray([""])
val v = [""]
[""]
[1, 2, 3].size
}
fun baz(arg: Array<Int> = []) {
if (true) ["yes"] else {["no"]}
}
class Foo(
val v: Array<Int> = []
)
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
@@ -1,15 +1,15 @@
fun test(): Array<Int> {
[1, 2]
[1, 2][0]
[1, 2].get(0)
<!UNSUPPORTED!>[1, 2]<!>
<!UNSUPPORTED!>[1, 2]<!>[0]
<!UNSUPPORTED!>[1, 2]<!>.get(0)
foo([""])
foo(<!UNSUPPORTED!>[""]<!>)
val p = [1, 2] <!UNRESOLVED_REFERENCE!>+<!> [3, 4]
val p = <!UNSUPPORTED!>[1, 2]<!> <!UNRESOLVED_REFERENCE!>+<!> <!UNSUPPORTED!>[3, 4]<!>
return [1, 2]
return <!UNSUPPORTED!>[1, 2]<!>
}
fun foo(a: Array<String> = [""]) {}
fun foo(a: Array<String> = <!UNSUPPORTED!>[""]<!>) {}
class A(val a: Array<Int> = [])
class A(val a: Array<Int> = <!UNSUPPORTED!>[]<!>)