Browse Source

fixed empty block eval

Nicolas Cannasse 4 năm trước cách đây
mục cha
commit
db4211b2a4
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      hxsl/Eval.hx

+ 1 - 1
hxsl/Eval.hx

@@ -164,7 +164,7 @@ class Eval {
 					out.push(handleReturn(e));
 				}
 			}
-			var t = if( isFinal ) out[out.length - 1].t else e.t;
+			var t = if( isFinal ) (out.length == 0 ? TVoid : out[out.length - 1].t) else e.t;
 			return { e : TBlock(out), t : t, p : e.p };
 		case TParenthesis(v):
 			var v = handleReturn(v, isFinal);