Add unification helper.

This commit is contained in:
Juraj Kirchheim
2019-02-24 08:25:04 +01:00
parent 8f81256731
commit 5e65f5354f

View File

@@ -121,6 +121,9 @@ class Types {
static public function toString(t:ComplexType)
return new Printer().printComplexType(t);
static public function unifiesWith(from:Type, to:Type)
return Context.unify(from, to);
static public function isSubTypeOf(t:Type, of:Type, ?pos)
return
ECheckType(ECheckType(macro null, toComplex(t)).at(pos), toComplex(of)).at(pos).typeof();