Skip to content

Commit

Permalink
Deprecate some API from haxe.macro.Compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Feb 3, 2024
1 parent de28889 commit b4780bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions std/haxe/macro/Compiler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Compiler {
Removes a (static) field from a given class by name.
An error is thrown when `className` or `field` is invalid.
**/
public static function removeField(className:String, field:String, ?isStatic:Bool) {
@:deprecated("Will be removed in Haxe 5.0") public static function removeField(className:String, field:String, ?isStatic:Bool) {
if (!path.match(className))
throw "Invalid " + className;
if (!ident.match(field))
Expand All @@ -107,7 +107,7 @@ class Compiler {
Set the type of a (static) field at a given class by name.
An error is thrown when `className` or `field` is invalid.
**/
public static function setFieldType(className:String, field:String, type:String, ?isStatic:Bool) {
@:deprecated("Will be removed in Haxe 5.0") public static function setFieldType(className:String, field:String, type:String, ?isStatic:Bool) {
if (!path.match(className))
throw "Invalid " + className;
if (!ident.match((field.charAt(0) == "$") ? field.substr(1) : field))
Expand All @@ -127,7 +127,7 @@ class Compiler {
Add metadata to a (static) field or class by name.
An error is thrown when `className` or `field` is invalid.
**/
public static function addMetadata(meta:String, className:String, ?field:String, ?isStatic:Bool) {
@:deprecated("Will be removed in Haxe 5.0") public static function addMetadata(meta:String, className:String, ?field:String, ?isStatic:Bool) {
if (!path.match(className))
throw "Invalid " + className;
if (field != null && !ident.match(field))
Expand Down Expand Up @@ -373,7 +373,7 @@ class Compiler {
/**
Load a type patch file that can modify the field types within declared classes and enums.
**/
public static function patchTypes(file:String):Void {
@:deprecated("Will be removed in Haxe 5.0") public static function patchTypes(file:String):Void {
var file = Context.resolvePath(file);
var f = sys.io.File.read(file, true);
try {
Expand Down

0 comments on commit b4780bb

Please sign in to comment.