Correct behaviour for break / continue inside function call arguments, including multiple ones. Additional tests.

This commit is contained in:
Mikhail Glukhikh
2015-04-21 14:42:11 +03:00
parent 3702089396
commit fd789cb68e
16 changed files with 188 additions and 2 deletions
@@ -0,0 +1,13 @@
fun bar(): Boolean { return true }
fun gav(arg: Any, z: String): String { return if (arg is String) <!DEBUG_INFO_SMARTCAST!>arg<!> else z }
public fun foo(x: String?, z: String?): Int {
do {
gav(if (x == null) break else <!DEBUG_INFO_SMARTCAST!>x<!>, z!!)
} while (bar())
// z is nullable despite of z!!
z<!UNSAFE_CALL!>.<!>length()
// x is null because of the break
return x<!UNSAFE_CALL!>.<!>length()
}