Explorar o código

Optimize for macro

杨博 %!s(int64=11) %!d(string=hai) anos
pai
achega
829dc6f58e
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      std/haxe/macro/TypeTools.hx

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

@@ -94,6 +94,9 @@ class TypeTools {
 	**/
 	public static function toComplexType(type : Null<Type>) : Null<ComplexType> return
 	{
+		#if macro
+		Context.toComplexType(type);
+		#else
 		switch (type) {
 			case null:
 				null;
@@ -133,6 +136,7 @@ class TypeTools {
 			default:
 				throw "Invalide type";
 		}
+		#end
 	}
 
 	static function toTypePath(baseType : BaseType, params : Array<Type>) : TypePath return {