FIR DFA: add tests about smartcasts in/after try-catch-finally

This commit is contained in:
Jinseong Jeon
2020-10-12 22:45:31 -07:00
committed by Dmitriy Novozhilov
parent 2c8c47399a
commit 146036010c
9 changed files with 137 additions and 0 deletions
@@ -0,0 +1,17 @@
fun castInTry(s: Any) {
try {
s as String // Potential cast exception
} finally {
s.<!UNRESOLVED_REFERENCE!>length<!> // Shouldn't be resolved
}
s.<!UNRESOLVED_REFERENCE!>length<!> // Shouldn't be resolved
}
fun castInTryAndFinally(s: Any) {
try {
s as String // Potential cast exception
} finally {
s as String // Potential cast exception
}
<!DEBUG_INFO_SMARTCAST!>s<!>.length // Should be smartcast
}