فهرست منبع

Optimize for macro

杨博 11 سال پیش
والد
کامیت
829dc6f58e
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  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
 	public static function toComplexType(type : Null<Type>) : Null<ComplexType> return
 	{
 	{
+		#if macro
+		Context.toComplexType(type);
+		#else
 		switch (type) {
 		switch (type) {
 			case null:
 			case null:
 				null;
 				null;
@@ -133,6 +136,7 @@ class TypeTools {
 			default:
 			default:
 				throw "Invalide type";
 				throw "Invalide type";
 		}
 		}
+		#end
 	}
 	}
 
 
 	static function toTypePath(baseType : BaseType, params : Array<Type>) : TypePath return {
 	static function toTypePath(baseType : BaseType, params : Array<Type>) : TypePath return {