Quick fix "add !!" for SMARTCAST_IMPOSSIBLE in certain situations
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
// ACTION: Cast expression 'a' to 'Foo'
|
||||
|
||||
interface Foo {
|
||||
fun bar()
|
||||
}
|
||||
|
||||
open class MyClass {
|
||||
open val a: Foo? = null
|
||||
|
||||
fun foo() {
|
||||
if (a != null) {
|
||||
<caret>a.bar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Add non-null asserted (!!) call" "true"
|
||||
// ACTION: Cast expression 'a' to 'Foo'
|
||||
|
||||
interface Foo {
|
||||
fun bar()
|
||||
}
|
||||
|
||||
open class MyClass {
|
||||
open val a: Foo? = null
|
||||
|
||||
fun foo() {
|
||||
if (a != null) {
|
||||
a!!.bar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user