浏览代码

fix missing type

Nicolas Cannasse 11 年之前
父节点
当前提交
b76be3762c
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      hxsl/Checker.hx

+ 2 - 1
hxsl/Checker.hx

@@ -189,7 +189,7 @@ class Checker {
 	}
 
 	function typeExpr( e : Expr, with : WithType ) : TExpr {
-		var type = null;
+		var type;
 		var ed = switch( e.expr ) {
 		case EConst(c):
 			type = switch( c ) {
@@ -335,6 +335,7 @@ class Checker {
 				tv.type = init.t;
 			}
 			vars.set(tv.name, tv);
+			type = TVoid;
 			TVarDecl(tv, init);
 		case EUnop(op,e1):
 			var e1 = typeExpr(e1, Value);