Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/kt524.kt
T
2014-10-01 18:52:52 +04:00

14 lines
416 B
Kotlin
Vendored

// KT-524 sure() returns T
package StringBuilder
//import kotlin.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) <!DEBUG_INFO_SMARTCAST!>this<!> else throw NullPointerException() }