blob: e88ca1d2805d4612346a830a3c255352a210f870 [file]
fun <T> Any?.unsafeCast(): T = this as T
fun <R> foo(returnType: String): R {
return when {
returnType == "Nothing" -> throw Exception()
else -> null.unsafeCast()
}
}
fun box(): String {
foo<String>("")
return "OK"
}