FIR DFA: isolate effects between blocks in try expression
This commit is contained in:
committed by
Dmitriy Novozhilov
parent
1f1e1828a7
commit
bd173ebebc
+5
-5
@@ -2,11 +2,11 @@ fun castInTry(s: Any) {
|
||||
try {
|
||||
s as String // Potential cast exception
|
||||
} catch (e: Exception) {
|
||||
s.length // shouldn't be resolved
|
||||
s.<!UNRESOLVED_REFERENCE!>length<!> // shouldn't be resolved
|
||||
} finally {
|
||||
s.length // shouldn't be resolved
|
||||
s.<!UNRESOLVED_REFERENCE!>length<!> // shouldn't be resolved
|
||||
}
|
||||
s.length // shouldn't be resolved
|
||||
s.<!UNRESOLVED_REFERENCE!>length<!> // shouldn't be resolved
|
||||
}
|
||||
|
||||
fun castInTryAndCatch(s: Any) {
|
||||
@@ -15,9 +15,9 @@ fun castInTryAndCatch(s: Any) {
|
||||
} catch (e: Exception) {
|
||||
s as String // Potential cast exception
|
||||
} finally {
|
||||
s.length // shouldn't be resolved
|
||||
s.<!UNRESOLVED_REFERENCE!>length<!> // shouldn't be resolved
|
||||
}
|
||||
s.length // should be smartcast
|
||||
s.<!UNRESOLVED_REFERENCE!>length<!> // should be smartcast
|
||||
}
|
||||
|
||||
fun castAtAll(s: Any) {
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@ fun castInTry(s: Any) {
|
||||
try {
|
||||
s as String // Potential cast exception
|
||||
} finally {
|
||||
s.length // Shouldn't be resolved
|
||||
s.<!UNRESOLVED_REFERENCE!>length<!> // Shouldn't be resolved
|
||||
}
|
||||
s.length // Shouldn't be resolved
|
||||
s.<!UNRESOLVED_REFERENCE!>length<!> // Shouldn't be resolved
|
||||
}
|
||||
|
||||
fun castInTryAndFinally(s: Any) {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ fun test3() {
|
||||
catch (e: B) {
|
||||
return
|
||||
}
|
||||
a.hashCode() // a is nullable here
|
||||
a.<!INAPPLICABLE_CANDIDATE!>hashCode<!>() // a is nullable here
|
||||
}
|
||||
fun test4() {
|
||||
var a: Int? = null
|
||||
|
||||
+1
-1
@@ -10,5 +10,5 @@ fun foo() {
|
||||
} catch (ex: Exception) {}
|
||||
bar(s)
|
||||
if (s != null) { }
|
||||
s.hashCode()
|
||||
s.<!INAPPLICABLE_CANDIDATE!>hashCode<!>()
|
||||
}
|
||||
Reference in New Issue
Block a user