KT-723 optional boxing after call to .inc()

This commit is contained in:
Alex Tkachman
2012-02-17 09:08:41 -05:00
parent 614c5018f6
commit 082fdebaae
3 changed files with 16 additions and 2 deletions
@@ -0,0 +1,8 @@
fun Int?.inc() : Int { if (this != null) return this.inc() else throw NullPointerException() }
public fun box() : String {
var i : Int? = 10
val j = i++
return if(j==10 && 11 == i) "OK" else "fail"
}