浏览代码

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
 	{
+		#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 {