fix compilation errors and make setVar public (#1)
* fix 1 * fix 2 * make setVar public
This commit is contained in:
+2
-1
@@ -1233,9 +1233,10 @@ class Checker {
|
||||
mergeType( typeExpr(defaultExpr, withType), defaultExpr);
|
||||
return withType == NoValue ? TVoid : tmin == null ? makeMono() : tmin;
|
||||
case ENew(cl, params):
|
||||
default:
|
||||
}
|
||||
error("Don't know how to type "+edef(expr).getName(), expr);
|
||||
return TDynamic;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -186,7 +186,7 @@ class Interp {
|
||||
assignOp("??=", function(v1, v2) return v1 == null ? v2 : v1);
|
||||
}
|
||||
|
||||
function setVar(name:String, v:Dynamic) {
|
||||
public function setVar(name:String, v:Dynamic) {
|
||||
if (allowStaticVariables && staticVariables.exists(name))
|
||||
staticVariables.set(name, v);
|
||||
else if (allowPublicVariables && publicVariables.exists(name))
|
||||
@@ -1024,4 +1024,4 @@ class Interp {
|
||||
c = Type.resolveClass(cl);
|
||||
return (c is IHScriptCustomConstructor) ? cast(c, IHScriptCustomConstructor).hnew(args) : Type.createInstance(c, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,6 +252,8 @@ class Macro {
|
||||
EMeta({ name : m, params : params == null ? [] : [for( p in params ) convert(p)], pos : mpos }, convert(esub));
|
||||
case ECheckType(e, t):
|
||||
ECheckType(convert(e), convertType(t));
|
||||
default:
|
||||
null;
|
||||
}, pos : #if hscriptPos { file : p.file, min : e.pmin, max : e.pmax } #else p #end }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user