Browse Source

bring back `optimize_for_loop` in display mode because it's actually important for abstracts and such

Simon Krajewski 9 years ago
parent
commit
f1321a7a07
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/typing/typer.ml

+ 2 - 4
src/typing/typer.ml

@@ -3548,12 +3548,10 @@ and type_expr ctx (e,p) (with_type:with_type) =
 			let e2 = type_expr ctx e2 NoValue in
 			(try Optimizer.optimize_for_loop_iterator ctx i e1 e2 p with Exit -> mk (TFor (i,e1,e2)) ctx.t.tvoid p)
 		in
-		let e = if ctx.com.display <> DMNone then
-			default()
-		else (match Optimizer.optimize_for_loop ctx (i,pi) e1 e2 p with
+		let e = match Optimizer.optimize_for_loop ctx (i,pi) e1 e2 p with
 			| Some e -> e
 			| None -> default()
-		) in
+		in
 		ctx.in_loop <- old_loop;
 		old_locals();
 		e