Skip to content

Commit

Permalink
Merge pull request #1280 from cryspen/fix-crash-bundle-disambiguation
Browse files Browse the repository at this point in the history
fix(engine) Add default case for disambiguation of bundle element names
  • Loading branch information
franziskuskiefer authored Feb 3, 2025
2 parents 3d2cbc0 + 3937a6a commit aaeb36b
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit aaeb36b

Please sign in to comment.