|
@@ -173,6 +173,22 @@ 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);
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ Like `follow`, follows all typedefs of `t` to reach the actual type.
|
|
|
|
+
|
|
|
|
+ Will however follow also abstracts to their underlying implementation,
|
|
|
|
+ if they are not a @:coreType abstract
|
|
|
|
+
|
|
|
|
+ If `t` is null, an internal exception is thrown.
|
|
|
|
+
|
|
|
|
+ Usage example:
|
|
|
|
+ var t = Context.typeof(macro new Map<String, String>());
|
|
|
|
+ trace(t); // TAbstract(Map,[TInst(String,[]),TInst(String,[])])
|
|
|
|
+ trace(t.followWithAbstracts()); // TInst(haxe.ds.StringMap, [TInst(String,[])])
|
|
|
|
+ **/
|
|
|
|
+ static public inline function followWithAbstracts( t : Type, once : Bool = false ) : Type
|
|
|
|
+ return Context.followWithAbstracts(t, once);
|
|
|
|
+
|
|
/**
|
|
/**
|
|
Returns true if `t1` and `t2` unify, false otherwise.
|
|
Returns true if `t1` and `t2` unify, false otherwise.
|
|
**/
|
|
**/
|