소스 검색

disallow usage of haxe.PosInfos in macro functions (fixed issue #1067)

Simon Krajewski 13 년 전
부모
커밋
dc9ab3bf8c
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      typeload.ml

+ 1 - 0
typeload.ml

@@ -1079,6 +1079,7 @@ let init_class ctx c p herits fields =
 				let to_dyn = function
 					| { tpackage = ["haxe";"macro"]; tname = "Expr"; tsub = Some ("ExprRequire"|"ExprOf"); tparams = [TPType t] } -> Some t
 					| { tpackage = []; tname = ("ExprRequire"|"ExprOf"); tsub = None; tparams = [TPType t] } -> Some t
+					| { tpackage = ["haxe"]; tname = ("PosInfos"); tsub = None; tparams = [] } -> error "haxe.PosInfos is not allowed on macro functions, use Context.currentPos() instead" p
 					| _ -> tdyn
 				in
 				{