Browse Source

add support for @:deprecated (fixed issue #1346)

Simon Krajewski 12 năm trước cách đây
mục cha
commit
35cbc1b7da
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      typeload.ml

+ 4 - 0
typeload.ml

@@ -980,6 +980,10 @@ let build_module_def ctx mt meta fvars context_init fbuild =
 			(match r with
 			(match r with
 			| None -> error "Build failure" p
 			| None -> error "Build failure" p
 			| Some e -> fbuild e; loop l)
 			| Some e -> fbuild e; loop l)
+		| (":deprecated",args,p) :: l ->
+			let msg = Printf.sprintf "%s is deprecated%s" (s_type_path (t_path mt)) (match args with [EConst(String s),_] -> ": " ^ s | _ -> "") in
+			ctx.com.warning msg p;
+			loop l
 		| _ :: l -> loop l
 		| _ :: l -> loop l
 		| [] -> ()
 		| [] -> ()
 	in
 	in