Browse Source

deprecate haxe.macro.MacroType (closes #1899)

Simon Krajewski 10 năm trước cách đây
mục cha
commit
85a5576509
2 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 1 0
      codegen.ml
  2. 1 0
      std/haxe/macro/MacroType.hx

+ 1 - 0
codegen.ml

@@ -590,6 +590,7 @@ let build_macro_type ctx pl p =
 	let path, field, args = (match pl with
 		| [TInst ({ cl_kind = KExpr (ECall (e,args),_) },_)]
 		| [TInst ({ cl_kind = KExpr (EArrayDecl [ECall (e,args),_],_) },_)] ->
+			ctx.com.warning ("haxe.macro.MacroType is deprecated, consider using @:genericBuild instead") p;
 			get_macro_path ctx e args p
 		| _ ->
 			error "MacroType requires a single expression call parameter" p

+ 1 - 0
std/haxe/macro/MacroType.hx

@@ -25,5 +25,6 @@ package haxe.macro;
 	This type is meant to be used to generate custom types using a macro.
 	For instance by doing MacroType<[my.Class.myMacro(55)]>
 **/
+@:deprecated("haxe.macro.MacroType is deprecated, consider using @:genericBuild instead")
 extern class MacroType<Const> {
 }