mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
14 lines
187 B
Kotlin
Vendored
14 lines
187 B
Kotlin
Vendored
fun <T> castToString(t: T) {
|
|
t as String
|
|
}
|
|
|
|
|
|
fun box(): String {
|
|
try {
|
|
castToString<Any?>(null)
|
|
} catch (e: Exception) {
|
|
return "OK"
|
|
}
|
|
return "Fail"
|
|
}
|