[FIR-TEST] Add new testdata generated after changes in previous commit

This commit is contained in:
Dmitriy Novozhilov
2019-12-11 16:16:22 +03:00
parent e9c02a1cca
commit 2536fa0cd5
4578 changed files with 104067 additions and 1 deletions
@@ -0,0 +1,4 @@
@Suppress("warnings")
val anonymous = object {
fun foo(p: String?? = "" as String) {}
}
@@ -0,0 +1,7 @@
@Suppress("warnings")
class C {
fun foo(p: String??) {
// Make sure errors are not suppressed:
p = ""
}
}
@@ -0,0 +1,6 @@
class C {
@Suppress("warnings")
companion object {
val foo: String?? = null as Nothing?
}
}
@@ -0,0 +1,4 @@
fun foo() {
@Suppress("warnings")
("" as String??)
}
@@ -0,0 +1,7 @@
@file:Suppress("warnings")
class C {
companion object {
val foo: String?? = null as Nothing?
}
}
@@ -0,0 +1,4 @@
class C {
@Suppress("warnings")
fun foo(p: String??) {}
}
@@ -0,0 +1,4 @@
@Suppress("warnings")
object C {
fun foo(p: String??) {}
}
@@ -0,0 +1,3 @@
class C {
fun foo(@Suppress("warnings") p: String?? = "" as String) {}
}
@@ -0,0 +1,4 @@
class C {
@Suppress("warnings")
val foo: String?? = null as Nothing?
}
@@ -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??
}
@@ -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??
}
@@ -0,0 +1,5 @@
class C {
val foo: String?
@Suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
get(): String?? = ""!! as String??
}
@@ -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()
}
@@ -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??
}
@@ -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?
}
@@ -0,0 +1,5 @@
class C {
val foo: String?
@Suppress("REDUNDANT_NULLABLE")
get(): String?? = null as Nothing??
}