Bug fix: jump out of a loop inside if condition

This commit is contained in:
Mikhail Glukhikh
2016-01-20 15:27:01 +03:00
parent b3c5760eb5
commit 859059d714
4 changed files with 34 additions and 6 deletions
@@ -0,0 +1,13 @@
fun checkJump(x: Int?, y: Int?) {
while (true) {
if (x ?: break == 0) {
y!!
} else {
y!!
}
// Ok
<!DEBUG_INFO_SMARTCAST!>y<!>.hashCode()
}
// Smart cast here is erroneous: y is nullable
y<!UNSAFE_CALL!>.<!>hashCode()
}
@@ -0,0 +1,3 @@
package
public fun checkJump(/*0*/ x: kotlin.Int?, /*1*/ y: kotlin.Int?): kotlin.Unit