浏览代码

TCast code lost!

I am using recursive block printing here.
If cast contains some useless (coz in block) statement, it won’t
printed in next gen_block_element iteration.

But *if* it have, something like `cast(hello(), SomeType)` then it will
print `hello()`.

I don’t know if this still issue for current Haxe, but it 3.1 it was.
Especially with analyzer.
PeyTy 10 年之前
父节点
当前提交
6c68b85889
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      genlua.ml

+ 2 - 1
genlua.ml

@@ -770,7 +770,8 @@ and gen_expr ctx e =
 
 and gen_block_element ?(after=false) ctx e =
     begin match e.eexpr with
-	| TTypeExpr _ | TCast _ -> ();
+	| TTypeExpr _ -> ()
+	| TCast (ce,_) -> gen_block_element ctx ce
 	| TBinop (op,e1,e2) when op <> Ast.OpAssign ->
 		let f () = gen_tbinop ctx op e1 e2 in
 		gen_iife_assign ctx f;