Skip to content

Commit b8d4bb2

Browse files
committed
RuleScriptedClass fix
1 parent 8ba9091 commit b8d4bb2

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

rulescript/RuleScriptInterp.hx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,4 +550,10 @@ class RuleScriptInterp extends hscript.Interp
550550
}
551551
};
552552
}
553+
554+
@:noCompletion
555+
inline public function argExpr(expr:Expr):Dynamic
556+
{
557+
return expr != null ? expr : null;
558+
}
553559
}

rulescript/macro/RuleScriptedClass.hx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,7 @@ class RuleScriptedClass
114114

115115
var scriptSuperCall = [
116116
for (i in 0...args.length)
117-
macro superCallArgs[$v{i}] != null ? __rulescript.interp.expr(superCallArgs[$v{i}]) : $
118-
{
119-
switch (args[i].t)
120-
{
121-
case TAbstract(t, params):
122-
t.get().name == 'Int' ? macro 0 : t.get().name == 'Float' ? macro 0.0 : null;
123-
default:
124-
macro null;
125-
}
126-
}
117+
macro __rulescript.interp.argExpr(superCallArgs[$v{i}])
127118
];
128119

129120
var funcArgs:Array<FunctionArg> = [

0 commit comments

Comments
 (0)