Do not compare boxed values with 0 via IFEQ/IFNE

This commit is contained in:
Alexander Udalov
2012-10-30 22:54:20 +04:00
parent cb99f26807
commit 4c5fe70804
3 changed files with 15 additions and 2 deletions
@@ -0,0 +1,8 @@
fun box(): String {
val x: Int? = 0
if (x != 0) return "Fail $x"
if (0 != x) return "Fail $x"
if (!(x == 0)) return "Fail $x"
if (!(0 == x)) return "Fail $x"
return "OK"
}