Quick-Fixes: Support USELESS_CAST diagnostic in "Remove cast" quick-fix
#KT-6422 Fixed
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
// "Remove cast" "true"
|
||||
fun foo(a: String) {
|
||||
val b = a
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Remove cast" "true"
|
||||
fun test(x: Any): String? {
|
||||
if (x is String) {
|
||||
return x
|
||||
}
|
||||
return null
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Remove cast" "true"
|
||||
fun foo(a: String) {
|
||||
val b = a <caret>as Any
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Remove cast" "true"
|
||||
fun test(x: Any): String? {
|
||||
if (x is String) {
|
||||
return x <caret>as String
|
||||
}
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user