瀏覽代碼

add TypeTools.unify

Simon Krajewski 12 年之前
父節點
當前提交
4c881cb1e8
共有 1 個文件被更改,包括 6 次插入0 次删除
  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
 		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`.