fix compilation errors and make setVar public (#1)

* fix 1

* fix 2

* make setVar public
This commit is contained in:
Leer
2023-09-23 20:32:31 +02:00
committed by GitHub
parent 220e5ce007
commit 7dd868aac7
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -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
View File
@@ -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);
}
}
}
+2
View File
@@ -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 }
}