浏览代码

Merge remote-tracking branch 'origin/development' into out_of_curiosity

Rudy Ges 1 年之前
父节点
当前提交
9ecdaf0191
共有 5 个文件被更改,包括 10 次插入22 次删除
  1. 1 1
      extra/BUILDING.md
  2. 0 6
      src-json/meta.json
  3. 8 13
      src/typing/fields.ml
  4. 1 1
      src/typing/typeloadFields.ml
  5. 0 1
      tests/runci/targets/Hl.hx

+ 1 - 1
extra/BUILDING.md

@@ -36,7 +36,7 @@ You need to install some native libraries as well as some OCaml libraries.
 To install the native libraries, use the appropriate system package manager.
 
  * Mac OS X
-    * Use [Homebrew](https://brew.sh/), `brew install zlib pcre2 mbedtls@2`.
+    * Use [Homebrew](https://brew.sh/), `brew install zlib pcre2 mbedtls`.
  * Debian / Ubuntu
     * `sudo apt install libpcre2-dev zlib1g-dev libmbedtls-dev`.
  * Windows (Cygwin)

+ 0 - 6
src-json/meta.json

@@ -316,12 +316,6 @@
 		"targets": ["TAbstract"],
 		"links": ["https://haxe.org/manual/types-abstract-forward.html"]
 	},
-	{
-		"name": "ForwardAccessOnAbstract",
-		"metadata": ":forward.accessOnAbstract",
-		"doc": "Generates @:forward field access on the abstract itself instead of the underlying type.",
-		"targets": ["TAbstract"]
-	},
 	{
 		"name": "ForwardNew",
 		"metadata": ":forward.new",

+ 8 - 13
src/typing/fields.ml

@@ -270,6 +270,12 @@ let type_field cfg ctx e i p mode (with_type : WithType.t) =
 		| None -> raise Not_found
 	in
 	let type_field_by_et f e t =
+		let e = match ctx.com.platform with
+			| Cs ->
+				{e with etype = t}
+			| _ ->
+				mk (TCast(e,None)) t e.epos
+		in
 		f e (follow_without_type t)
 	in
 	let type_field_by_e f e =
@@ -291,15 +297,7 @@ let type_field cfg ctx e i p mode (with_type : WithType.t) =
 		type_field_by_forward f Meta.ForwardStatics a
 	in
 	let type_field_by_forward_member f e a tl =
-		let f () =
-			let t = Abstract.get_underlying_type ~return_first:true a tl in
-			let e = if Meta.has Meta.ForwardAccessOnAbstract a.a_meta then
-				e
-			else
-				mk (TCast(e,None)) t e.epos
-			in
-			type_field_by_et f e t
-		in
+		let f () = type_field_by_et f e (Abstract.get_underlying_type ~return_first:true a tl) in
 		type_field_by_forward f Meta.Forward a
 	in
 	let type_field_by_typedef f e td tl =
@@ -382,10 +380,7 @@ let type_field cfg ctx e i p mode (with_type : WithType.t) =
 					field_access f FHAnon
 				)
 			| CTypes tl ->
-				type_field_by_list (fun (t,_) ->
-					let e = mk (TCast(e,None)) t e.epos in
-					type_field_by_et type_field_by_type e t
-				) tl
+				type_field_by_list (fun (t,_) -> type_field_by_et type_field_by_type e t) tl
 			| CUnknown ->
 				if not (List.exists (fun (m,_) -> m == r) ctx.monomorphs.perfunction) && not (ctx.untyped && ctx.com.platform = Neko) then
 					ctx.monomorphs.perfunction <- (r,p) :: ctx.monomorphs.perfunction;

+ 1 - 1
src/typing/typeloadFields.ml

@@ -631,7 +631,7 @@ let create_typer_context_for_field ctx cctx fctx cff =
 		monomorphs = {
 			perfunction = [];
 		};
-		type_params = if fctx.is_static && not fctx.is_abstract_member then [] else ctx.type_params;
+		type_params = if fctx.is_static && not fctx.is_abstract_member && not (Meta.has Meta.LibType cctx.tclass.cl_meta) (* TODO: remove this *) then [] else ctx.type_params;
 	} in
 
 	let c = cctx.tclass in

+ 0 - 1
tests/runci/targets/Hl.hx

@@ -39,7 +39,6 @@ class Hl {
 			case "Mac":
 				runNetworkCommand("brew", ["update", '--preinstall']);
 				runNetworkCommand("brew", ["bundle", '--file=${hlSrc}/Brewfile']);
-				runNetworkCommand("brew", ["link", "mbedtls@2", "--force"]);
 			case "Windows":
 				//pass
 		}