mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
10 lines
217 B
Kotlin
10 lines
217 B
Kotlin
fun foo(s: String): String? {
|
|
try {
|
|
Integer.parseInt(s);
|
|
return "no message";
|
|
}
|
|
catch(e: NumberFormatException) {
|
|
return (e : Throwable).getMessage(); // Work around an overload-resolution bug
|
|
}
|
|
}
|