Explorar o código

fixed empty block eval

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