소스 검색

added @:allowConstraint as a temp fix for method type parameters constraint

Nicolas Cannasse 13 년 전
부모
커밋
89ce2eae7c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      typeload.ml

+ 1 - 1
typeload.ml

@@ -939,7 +939,7 @@ let init_class ctx c p herits fields =
 						| TPType t -> lookup_type t
 						| TPExpr _ -> false
 					in
-					if lookup_fun { fd with f_type = None; f_params = [] } then error "This notation is not allowed because it can't be checked" p);
+					if lookup_fun { fd with f_type = None; f_params = [] } && not (has_meta ":allowConstrainst" f.cff_meta) then error "This notation is not allowed because it can't be checked" p);
 				type_type_params ctx ([],name) (fun() -> !params) p (n,flags)
 			) fd.f_params;
 			let params = !params in