avoid unnecessary null checks when receiver of '!!' or 'as' operator is not nullable

This commit is contained in:
Alex Tkachman
2014-03-29 21:28:00 +03:00
parent 09a8e284e5
commit 371dfc6ec4
3 changed files with 16 additions and 4 deletions
@@ -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?