Browse Source

[std] remove @:require(haxe_ver) metas

This was intended for API doc generation, but these metas were never added to new APIs consistently and dox was also never updated to show this info. They serve no purpose otherwise, since the standard lib is not backwards-compatible with older Haxe versions.

It makes sense to remove them now because the checks start failing if haxe_ver is changed to a SemVer (see #8302).

Starting with Haxe 4.1, it might be nice to start using JavaDoc @since tags (respected by both dox and vshaxe).
Jens Fischer 6 năm trước cách đây
mục cha
commit
7b18184848
4 tập tin đã thay đổi với 0 bổ sung13 xóa
  1. 0 2
      std/haxe/io/Path.hx
  2. 0 8
      std/haxe/macro/Context.hx
  3. 0 2
      std/haxe/macro/Type.hx
  4. 0 1
      std/sys/FileSystem.hx

+ 0 - 2
std/haxe/io/Path.hx

@@ -285,7 +285,6 @@ class Path {
 
 		If `path` is `null`, the result is unspecified.
 	**/
-	@:require(haxe_ver >= 3.1)
 	public static function removeTrailingSlashes ( path : String ) : String {
 		while (true) {
 			switch(path.charCodeAt(path.length - 1)) {
@@ -299,7 +298,6 @@ class Path {
 	/**
 		Returns `true` if the path is an absolute path, and `false` otherwise.
 	**/
-	@:require(haxe_ver >= 3.2)
 	public static function isAbsolute ( path : String ) : Bool {
 		if (StringTools.startsWith(path, '/')) return true;
 		if (path.charAt(1) == ':') return true;

+ 0 - 8
std/haxe/macro/Context.hx

@@ -101,7 +101,6 @@ class Context {
 		Might return `null` if no specific type is expected or if the calling
 		macro is not an expression-macro.
 	**/
-	@:require(haxe_ver >= 3.1)
 	public static function getExpectedType():Null<Type> {
 		return load("get_expected_type", 0)();
 	}
@@ -112,7 +111,6 @@ class Context {
 
 		Returns `null` if the current macro is not a `@:genericBuild` macro.
 	**/
-	@:require(haxe_ver >= 3.2)
 	public static function getCallArguments():Null<Array<Expr>> {
 		return load("get_call_arguments", 0)();
 	}
@@ -193,7 +191,6 @@ class Context {
 		Similar to `getLocalVars`, but returns elements of type `TVar` instead
 		of `Type`.
 	**/
-	@:require(haxe_ver >= 3.102)
 	public static function getLocalTVars() : Map<String,Type.TVar> {
 		return load("local_vars", 1)(true);
 	}
@@ -334,7 +331,6 @@ class Context {
 
 		*Note*: the callback is still invoked when generation is disabled with  `--no-output`.
 	**/
-	@:require(haxe_ver >= 3.1)
 	public static function onAfterGenerate( callback : Void -> Void ) {
 		load("on_after_generate",1)(callback);
 	}
@@ -379,7 +375,6 @@ class Context {
 		Typing the expression may result in a compiler error which can be
 		caught using `try ... catch`.
 	**/
-	@:require(haxe_ver >= 3.1)
 	public static function typeExpr( e : Expr ) : TypedExpr {
 		return load("type_expr", 1)(e);
 	}
@@ -391,7 +386,6 @@ class Context {
 		caught using `try ... catch`.
 		Resolution is performed based on the current context in which the macro is called.
 	**/
-	@:require(haxe_ver >= 3.3)
 	public static function resolveType( t : ComplexType, p : Position ) : Type {
 		return load("resolve_type", 2)(t,p);
 	}
@@ -526,7 +520,6 @@ class Context {
 		the expression returned by this method in a static variable and using the
 		compilation server.
 	**/
-	@:require(haxe_ver >= 3.2)
 	public static function storeTypedExpr( t : Type.TypedExpr ) : Expr {
 		return load("store_typed_expr",1)(t);
 	}
@@ -546,7 +539,6 @@ class Context {
 		the expression returned by this method in a static variable and using the
 		compilation server.
 	**/
-	@:require(haxe_ver >= 4.0)
 	public static function storeExpr( e : Expr ) : Expr {
 		return load("store_expr",1)(e);
 	}

+ 0 - 2
std/haxe/macro/Type.hx

@@ -529,13 +529,11 @@ typedef AbstractType = BaseType & {
 	/**
 		The method used for resolving unknown field access, if available.
 	**/
-	@:require(haxe_ver >= 3.3)
 	var resolve : Null<ClassField>;
 
 	/**
 		The method used for resolving unknown field access, if available.
 	**/
-	@:require(haxe_ver >= 4.0)
 	var resolveWrite : Null<ClassField>;
 }
 

+ 0 - 1
std/sys/FileSystem.hx

@@ -69,7 +69,6 @@ extern class FileSystem {
 
 		If `relPath` is null, the result is unspecified.
 	**/
-	//@:require(haxe_ver >= 3.2)
 	static function absolutePath( relPath : String ) : String;
 
 	/**