Test for kt-524

This commit is contained in:
Andrey Breslav
2011-11-29 22:14:16 +03:00
parent dd4cc1686d
commit be29dd9155
@@ -0,0 +1,17 @@
// KT-524 sure() returns T
// +JDK
namespace StringBuilder
import java.lang.StringBuilder
//import std.io.*
//import java.io.*
fun main(args : Array<String>) {
}
val Int.bd : StringBuilder get() = StringBuilder(this.toString())
fun StringBuilder.plus(other : StringBuilder) : StringBuilder = this.append(other).sure1() // !!!
fun <T : Any> T?.sure1() : T { return if (this != null) this else throw NullPointerException() }