KT-2823 TypeCastException has no message

#KT-2823 Fixed
This commit is contained in:
Natalia.Ukhorskaya
2012-10-10 14:45:43 +04:00
parent a31b748092
commit 78d22e9f81
4 changed files with 39 additions and 4 deletions
@@ -0,0 +1,14 @@
// KT-2823 TypeCastException has no message
fun box(): String {
try {
val a: Any? = null
a as Array<String>
}
catch(e: TypeCastException) {
if (e.getMessage() == "jet.Any? cannot be cast to jet.Array<jet.String>") {
return "OK"
}
}
return "fail"
}