avoid unnecessary null checks when receiver of '!!' or 'as' operator is not nullable
This commit is contained in:
@@ -2,6 +2,8 @@ package foo
|
||||
|
||||
class A
|
||||
|
||||
fun <T> Any.cast() = this!! as T
|
||||
|
||||
fun box(): String {
|
||||
val a = null
|
||||
val s = a as A?
|
||||
|
||||
Reference in New Issue
Block a user