Browse Source

add TypeTools.unify

Simon Krajewski 12 years ago
parent
commit
4c881cb1e8
1 changed files with 6 additions and 0 deletions
  1. 6 0
      std/haxe/macro/TypeTools.hx

+ 6 - 0
std/haxe/macro/TypeTools.hx

@@ -57,6 +57,12 @@ class TypeTools {
 	static public inline function follow( t : Type, ?once : Bool ) : Type
 	static public inline function follow( t : Type, ?once : Bool ) : Type
 		return Context.follow(t, once);
 		return Context.follow(t, once);
 		
 		
+	/**
+		Returns true if `t1` and `t2` unify, false otherwise.
+	**/
+	static public inline function unify( t1 : Type, t2:Type ) : Bool
+		return Context.unify(t1, t2);
+		
 	/**
 	/**
 		Returns a syntax-level type corresponding to Type `t`.
 		Returns a syntax-level type corresponding to Type `t`.