Add quick fixes for SMARTCAST_IMPOSSIBLE in 'if' #KT-27184 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
a0162adbf9
commit
cf3215b96e
@@ -0,0 +1,13 @@
|
||||
// "Replace 'if' expression with elvis expression" "true"
|
||||
// WITH_RUNTIME
|
||||
class Test {
|
||||
var x: Any? = null
|
||||
|
||||
fun test() {
|
||||
val i = if (x is String) foo(<caret>x) else bar()
|
||||
}
|
||||
|
||||
fun foo(s: String) = 1
|
||||
|
||||
fun bar() = 0
|
||||
}
|
||||
Reference in New Issue
Block a user