mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 00:21:32 +00:00
18 lines
282 B
Kotlin
Vendored
18 lines
282 B
Kotlin
Vendored
// "Lift assignment out of 'try' expression" "true"
|
|
// WITH_RUNTIME
|
|
|
|
fun foo() {
|
|
val x: Int
|
|
try {
|
|
x = 1
|
|
}
|
|
catch (e: RuntimeException) {
|
|
<caret>x = 2
|
|
}
|
|
catch (e: Exception) {
|
|
x = 3
|
|
}
|
|
catch (e: Throwable) {
|
|
x = 4
|
|
}
|
|
} |