Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove weird partial resolution #11338

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/context/resolution.ml
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,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) ->
Expand Down
9 changes: 1 addition & 8 deletions src/typing/typeload.ml
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,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 =
Expand Down