Tests for 'suppress' annotation
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
suppress("warnings")
|
||||
class C {
|
||||
fun foo(p: String??) {
|
||||
// Make sure errors are not suppressed:
|
||||
<!VAL_REASSIGNMENT!>p<!> = ""
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class C {
|
||||
suppress("warnings")
|
||||
class 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??) {}
|
||||
}
|
||||
+3
@@ -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?
|
||||
}
|
||||
+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?? = ""!! <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as<!> String??
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
class C {
|
||||
fun foo(): String?? = ""!! <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as<!> String??
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class C {
|
||||
suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
class object {
|
||||
val foo: String?? = ""!! <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as<!> String??
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class C {
|
||||
suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
fun foo(): String?? = ""!! <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as<!> String??
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
object C {
|
||||
fun foo(): String?? = ""!! <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as<!> String??
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class C {
|
||||
fun foo(suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION") p: String?? = ""!! <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as<!> String??) = p
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class C {
|
||||
suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
val foo: String?? = ""!! <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as<!> String??
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class C {
|
||||
val foo: String?
|
||||
[suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
get(): String?? = ""!! <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as<!> String??
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
suppress("REDUNDANT_NULLABLE")
|
||||
class C {
|
||||
fun foo(): String?? = null <!USELESS_CAST!>as<!> Nothing??
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class C {
|
||||
suppress("REDUNDANT_NULLABLE")
|
||||
class object {
|
||||
val foo: String?? = null <!USELESS_CAST!>as<!> Nothing??
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class C {
|
||||
suppress("REDUNDANT_NULLABLE")
|
||||
fun foo(): String?? = null <!USELESS_CAST!>as<!> Nothing??
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class C {
|
||||
fun foo(): Any? {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
val v: String?? = null <!USELESS_CAST!>as<!> Nothing??
|
||||
return v
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
suppress("REDUNDANT_NULLABLE")
|
||||
object C {
|
||||
fun foo(): String?? = null <!USELESS_CAST!>as<!> Nothing??
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class C {
|
||||
fun foo(suppress("REDUNDANT_NULLABLE") p: String?? = null <!USELESS_CAST!>as<!> Nothing??) = p
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class C {
|
||||
suppress("REDUNDANT_NULLABLE")
|
||||
val foo: String?? = null <!USELESS_CAST!>as<!> Nothing?
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class C {
|
||||
val foo: String?
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
get(): String?? = null <!USELESS_CAST!>as<!> Nothing??
|
||||
}
|
||||
Reference in New Issue
Block a user