Add Exprs.as for ECheckType.

This commit is contained in:
Juraj Kirchheim
2018-10-03 11:50:21 +02:00
parent 5f959f788e
commit e1e487079b

View File

@@ -43,8 +43,11 @@ class Exprs {
} }
static public inline function is(e:Expr, c:ComplexType) static public inline function is(e:Expr, c:ComplexType)
return ECheckType(e, c).at(e.pos).typeof().isSuccess(); return e.as(c).typeof().isSuccess();
static public inline function as(e:Expr, c:ComplexType)
return ECheckType(e, c).at(e.pos);
static public function finalize(e:Expr, ?nuPos:Position, ?rules:Dynamic<String>, ?skipFields = false, ?callPos:PosInfos) { static public function finalize(e:Expr, ?nuPos:Position, ?rules:Dynamic<String>, ?skipFields = false, ?callPos:PosInfos) {
if (nuPos == null) if (nuPos == null)
nuPos = Context.currentPos(); nuPos = Context.currentPos();