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

fix(engine) Add default case for disambiguation of bundle element names #1280

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions engine/lib/concrete_ident/concrete_ident.ml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ module MakeToString (R : VIEW_RENDERER) = struct
in
let is_assoc_or_field (rel_path : View.RelPath.t) : bool =
match List.last rel_path with
| Some (`AssociatedItem _ | `Field _) -> true
| Some (`AssociatedItem (_, (`Trait _ | `Impl (_, `Trait, _))))
| Some (`Field _) ->
true
| _ -> false
in
let name =
Expand Down Expand Up @@ -284,7 +286,7 @@ module MakeToString (R : VIEW_RENDERER) = struct
path (* This might shadow, we should escape *))
(* Find the shortest name that doesn't exist already *)
|> List.find ~f:(Hash_set.mem name_set >> not)
|> Option.value_exn
|> Option.value ~default:(name ^ ([%hash: t] i |> Int.to_string))
else name
in
(* Update the maps and hashtables *)
Expand Down