Highlighting "as Foo" for useless casts in gray.

#KT-6070 fixed
This commit is contained in:
Evgeny Gerashchenko
2014-11-28 21:33:52 +03:00
parent 20ee59c1e5
commit a3fdce8131
34 changed files with 60 additions and 53 deletions
@@ -1,4 +1,4 @@
suppress("REDUNDANT_NULLABLE")
class C {
fun foo(): String?? = null <!USELESS_CAST!>as<!> Nothing??
fun foo(): String?? = null <!USELESS_CAST!>as Nothing??<!>
}
@@ -1,6 +1,6 @@
class C {
suppress("REDUNDANT_NULLABLE")
class object {
val foo: String?? = null <!USELESS_CAST!>as<!> Nothing??
val foo: String?? = null <!USELESS_CAST!>as Nothing??<!>
}
}
@@ -1,4 +1,4 @@
fun foo(): Any? {
[suppress("REDUNDANT_NULLABLE")]
return null <!USELESS_CAST!>as<!> Nothing??
return null <!USELESS_CAST!>as Nothing??<!>
}
@@ -1,4 +1,4 @@
class C {
suppress("REDUNDANT_NULLABLE")
fun foo(): String?? = null <!USELESS_CAST!>as<!> Nothing??
fun foo(): String?? = null <!USELESS_CAST!>as Nothing??<!>
}
@@ -1,7 +1,7 @@
class C {
fun foo(): Any? {
[suppress("REDUNDANT_NULLABLE")]
val v: String?? = null <!USELESS_CAST!>as<!> Nothing??
val v: String?? = null <!USELESS_CAST!>as Nothing??<!>
return v
}
}
@@ -1,4 +1,4 @@
suppress("REDUNDANT_NULLABLE")
object C {
fun foo(): String?? = null <!USELESS_CAST!>as<!> Nothing??
fun foo(): String?? = null <!USELESS_CAST!>as Nothing??<!>
}
@@ -1,3 +1,3 @@
class C {
fun foo(suppress("REDUNDANT_NULLABLE") p: String?? = null <!USELESS_CAST!>as<!> Nothing??) = p
fun foo(suppress("REDUNDANT_NULLABLE") p: String?? = null <!USELESS_CAST!>as Nothing??<!>) = p
}
@@ -1,4 +1,4 @@
class C {
suppress("REDUNDANT_NULLABLE")
val foo: String?? = null <!USELESS_CAST!>as<!> Nothing?
val foo: String?? = null <!USELESS_CAST!>as Nothing?<!>
}
@@ -1,5 +1,5 @@
class C {
val foo: String?
[suppress("REDUNDANT_NULLABLE")]
get(): String?? = null <!USELESS_CAST!>as<!> Nothing??
get(): String?? = null <!USELESS_CAST!>as Nothing??<!>
}