@@ -200,6 +200,8 @@ let promote_complex_rhs ctx e =
{ e with eexpr = TMeta(m,loop f e1)}
| TReturn _ | TThrow _ ->
find e
+ | TContinue | TBreak ->
+ e
| TCast(e1,None) when ctx.config.pf_ignore_unsafe_cast ->
loop f e1
| _ ->
@@ -0,0 +1,19 @@
+package unit.issues;
+
+class Issue3197 extends Test {
+ function test() {
+ var v = "good";
+ for (i in 0...10) {
+ v = if (i == 1) "bad" else break;
+ }
+ eq(v, "good");
+ var a = [];
+ var v = if (i == 1) i else continue;
+ a.push(v);
+ eq(a.length, 1);
+ eq(a[0], 1);
+}