Explorar o código

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 %!s(int64=10) %!d(string=hai) anos
pai
achega
6c68b85889
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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;