Test for kt-524
This commit is contained in:
@@ -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() }
|
||||||
Reference in New Issue
Block a user