FIR checker: reproduce KT-42350

This commit is contained in:
Jinseong Jeon
2020-09-30 13:12:59 -07:00
committed by Dmitriy Novozhilov
parent da69e3db7c
commit ea2f773e54
9 changed files with 262 additions and 0 deletions
@@ -0,0 +1,39 @@
fun assignedInTry() {
val a: Int
try {
a = 42
} finally {
}
a.hashCode()
}
fun sideEffectBeforeAssignmentInTry(s: Any) {
val a: Int
try {
s as String // Potential cast exception
a = 42
} finally {
}
a.hashCode()
}
fun assignedInTryAndFinally() {
val a: Int
try {
<!UNUSED_VALUE!>a =<!> 42
} finally {
<!VAL_REASSIGNMENT!>a<!> = 41
}
a.hashCode()
}
fun sideEffectBeforeAssignmentInTryButNotFinally(s: Any) {
val a: Int
try {
s as String // Potential cast exception
<!UNUSED_VALUE!>a =<!> 42
} finally {
<!VAL_REASSIGNMENT!>a<!> = 41
}
a.hashCode()
}