[FIR-TEST] Add new testdata generated after changes in previous commit
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
@Suppress("warnings")
|
||||
val anonymous = object {
|
||||
fun foo(p: String?? = "" as String) {}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
@Suppress("warnings")
|
||||
class C {
|
||||
fun foo(p: String??) {
|
||||
// Make sure errors are not suppressed:
|
||||
p = ""
|
||||
}
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
class C {
|
||||
@Suppress("warnings")
|
||||
companion object {
|
||||
val foo: String?? = null as Nothing?
|
||||
}
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
@Suppress("warnings")
|
||||
("" as String??)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
@file:Suppress("warnings")
|
||||
|
||||
class C {
|
||||
companion object {
|
||||
val foo: String?? = null as Nothing?
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
class C {
|
||||
@Suppress("warnings")
|
||||
fun foo(p: String??) {}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
@Suppress("warnings")
|
||||
object C {
|
||||
fun foo(p: String??) {}
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
class C {
|
||||
fun foo(@Suppress("warnings") p: String?? = "" as String) {}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
class C {
|
||||
@Suppress("warnings")
|
||||
val foo: String?? = null as Nothing?
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
class C {
|
||||
val foo: String?
|
||||
@Suppress("warnings")
|
||||
get(): String?? = null as Nothing?
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
@Suppress("REDUNDANT_NULLABLE")
|
||||
class C {
|
||||
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
fun foo(): String?? = ""!! as String??
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
@Suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
class C {
|
||||
fun foo(): String?? = ""!! as String??
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class C {
|
||||
@Suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
companion object {
|
||||
val foo: String?? = ""!! as String??
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo(): Any? {
|
||||
@Suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
return ""!! as String??
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class C {
|
||||
@Suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
fun foo(): String?? = ""!! as String??
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
@Suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
object C {
|
||||
fun foo(): String?? = ""!! as String??
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class C {
|
||||
fun foo(@Suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION") p: String?? = ""!! as String??) = p
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class C {
|
||||
@Suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
val foo: String?? = ""!! as String??
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class C {
|
||||
val foo: String?
|
||||
@Suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
get(): String?? = ""!! as String??
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
fun <T : CharSequence> foo(x: Array<Any>, y: IntArray, block: (T, Int) -> Int) {
|
||||
var r: Any?
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
// comment
|
||||
/* comment */
|
||||
r = block(x[0] as T, "" as Int)
|
||||
|
||||
// to prevent unused assignment diagnostic for the above statement
|
||||
r.hashCode()
|
||||
|
||||
var i = 1
|
||||
|
||||
if (i != 1) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
i += block(x[0] as T, "" as Int).toInt()
|
||||
}
|
||||
|
||||
if (i != 1)
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
i += block(x[0] as T, "" as Int).toInt()
|
||||
|
||||
if (i != 2)
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
i += block(x[0] as T, "" as Int).toInt()
|
||||
else
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
i += block(x[1] as T, "" as Int).toInt()
|
||||
|
||||
while (i != 1)
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
i += block(x[0] as T, "" as Int).toInt()
|
||||
|
||||
do
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
i += block(x[0] as T, "" as Int).toInt()
|
||||
while (i != 1)
|
||||
|
||||
for (j in 1..100)
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
i += block(x[0] as T, "" as Int).toInt()
|
||||
|
||||
when (i) {
|
||||
1 ->
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
i += block(x[0] as T, "" as Int).toInt()
|
||||
}
|
||||
|
||||
val l: () -> Unit = {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
i += block(x[0] as T, "" as Int).toInt()
|
||||
}
|
||||
l()
|
||||
|
||||
// many empty new lines
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
|
||||
|
||||
y[i] += block(x[0] as T, "" as Int).toInt()
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
fun <T : CharSequence> foo(x: Array<Any>, block: (T, Int) -> Int) {
|
||||
var r: Any?
|
||||
|
||||
@Suppress("UNCHECKED_CAST") r = block(x[0] as T, "" as Int)
|
||||
|
||||
// to prevent unused assignment diagnostic for the above statement
|
||||
r.<!INAPPLICABLE_CANDIDATE!>hashCode<!>()
|
||||
|
||||
var i = 1
|
||||
|
||||
if (i != 1) {
|
||||
@Suppress("UNCHECKED_CAST") i += block(x[0] as T, "" as Int).toInt()
|
||||
}
|
||||
|
||||
if (i != 1) @Suppress("UNCHECKED_CAST")
|
||||
i += block(x[0] as T, "" as Int).toInt()
|
||||
|
||||
if (i != 1) @Suppress("UNCHECKED_CAST") i += block(x[0] as T, "" as Int).toInt()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
@Suppress("REDUNDANT_NULLABLE")
|
||||
class C {
|
||||
fun foo(): String?? = null as Nothing??
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class C {
|
||||
@Suppress("REDUNDANT_NULLABLE")
|
||||
companion object {
|
||||
val foo: String?? = null as Nothing??
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo(): Any? {
|
||||
@Suppress("REDUNDANT_NULLABLE")
|
||||
return null as Nothing??
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class C {
|
||||
@Suppress("REDUNDANT_NULLABLE")
|
||||
fun foo(): String?? = null as Nothing??
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class C {
|
||||
fun foo(): Any? {
|
||||
@Suppress("REDUNDANT_NULLABLE")
|
||||
val v: String?? = null as Nothing??
|
||||
return v
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
@Suppress("REDUNDANT_NULLABLE")
|
||||
object C {
|
||||
fun foo(): String?? = null as Nothing??
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class C {
|
||||
fun foo(@Suppress("REDUNDANT_NULLABLE") p: String?? = null as Nothing??) = p
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class C {
|
||||
@Suppress("REDUNDANT_NULLABLE")
|
||||
val foo: String?? = null as Nothing?
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class C {
|
||||
val foo: String?
|
||||
@Suppress("REDUNDANT_NULLABLE")
|
||||
get(): String?? = null as Nothing??
|
||||
}
|
||||
Reference in New Issue
Block a user