Files
kotlin-fork/idea/testData/quickfix/foldTryCatch/conditional.kt
T
Valentin Kipyatkov 7625672914 Better test data
2016-09-23 10:07:15 +03:00

16 lines
322 B
Kotlin
Vendored

// "class org.jetbrains.kotlin.idea.quickfix.LiftAssignmentOutOfTryFix" "false"
// ACTION: Make variable mutable
// ERROR: Val cannot be reassigned
// WITH_RUNTIME
fun foo(arg: Boolean) {
val x: Int
try {
if (arg) {
x = 1
}
}
catch (e: Exception) {
<caret>x = 2
}
}