Parcourir la source

Support @:haxe.warning options for @:enum deprecation warning

Rudy Ges il y a 2 ans
Parent
commit
34afe73f3c
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      src/typing/typeloadModule.ml

+ 3 - 1
src/typing/typeloadModule.ml

@@ -202,7 +202,9 @@ module ModuleLevel = struct
 				begin match p_enum_meta with
 					| None when a.a_enum -> a.a_meta <- (Meta.Enum,[],null_pos) :: a.a_meta; (* HAXE5: remove *)
 					| None -> ()
-					| Some p -> warning ctx WDeprecated "`@:enum abstract` is deprecated in favor of `enum abstract`" p
+					| Some p ->
+						let options = Warning.from_meta d.d_meta in
+						ctx.com.warning WDeprecated options "`@:enum abstract` is deprecated in favor of `enum abstract`" p
 				end;
 				decls := (TAbstractDecl a, decl) :: !decls;
 				match d.d_data with