Add some tests for inference and DFA of try/catch/finally

This commit is contained in:
Dmitriy Novozhilov
2019-02-17 12:15:27 +03:00
parent 8d3271cc68
commit 4e64b07727
16 changed files with 865 additions and 0 deletions
@@ -0,0 +1,19 @@
// !WITH_NEW_INFERENCE
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_VALUE -VARIABLE_WITH_REDUNDANT_INITIALIZER
// Related issue: KT-28370
fun test1(s1: String?) {
var s: String? = null
s = ""
try {
s = ""
requireNotNull(s1)
}
catch (e: Exception) {
return
}
finally {
<!DEBUG_INFO_SMARTCAST!>s<!>.length
}
<!DEBUG_INFO_SMARTCAST!>s<!>.length
}