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

12 lines
296 B
Kotlin
Vendored

// KT-313 Bug in substitutions in a function returning its type parameter T
fun <T> Iterable<T>.join(separator : String?) : String {
return separator.npe()
}
fun <T : Any> T?.npe() : T {
if (this == null)
throw NullPointerException()
return <!DEBUG_INFO_SMARTCAST!>this<!>;
}