[FIR] Report UNSUPPORTED on array literals not from annotation classes ^KT-50750 Fixed
This commit is contained in:
compiler/testData/diagnostics/tests/collectionLiterals/collectionLiteralsOutsideOfAnnotations.fir.kt
Vendored
-21
@@ -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> = []
|
||||
)
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
|
||||
|
||||
+8
-8
@@ -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!>[]<!>)
|
||||
|
||||
Reference in New Issue
Block a user