Browse Source

remove weirdness (#11338)

Simon Krajewski 9 months ago
parent
commit
2dc801f1e7
2 changed files with 1 additions and 19 deletions
  1. 0 11
      src/context/resolution.ml
  2. 1 8
      src/typing/typeload.ml

+ 0 - 11
src/context/resolution.ml

@@ -203,17 +203,6 @@ class resolution_list (id : string list) = object(self)
 		self#cache_type_imports;
 		StringMap.find alias type_import_cache
 
-	method find_type_import_weirdly pack name =
-		let rec find l = match l with
-			| [] ->
-				raise Not_found
-			| {r_kind = RTypeImport(alias,mt); r_pos = p} :: l ->
-				if  t_path mt = (pack,name) then (mt,p) else find l
-			| _ :: l ->
-				find l
-		in
-		find l
-
 	method extract_type_imports =
 		ExtList.List.filter_map (fun res -> match res.r_kind with
 			| RTypeImport(_,mt) ->

+ 1 - 8
src/typing/typeload.ml

@@ -112,14 +112,7 @@ let find_type_in_current_module_context ctx pack name =
 			ImportHandling.mark_import_position ctx pi;
 			t
 	end else begin
-		(* All this is very weird *)
-		try
-			List.find (fun mt -> t_path mt = (pack,name)) ctx.m.curmod.m_types
-		with Not_found ->
-			(* see also https://github.com/HaxeFoundation/haxe/issues/9150 *)
-			let t,pi = ctx.m.import_resolution#find_type_import_weirdly pack name in
-			ImportHandling.mark_import_position ctx pi;
-		t
+		List.find (fun mt -> t_path mt = (pack,name)) ctx.m.curmod.m_types
 	end
 
 let find_in_wildcard_imports ctx mname p f =