Skip to content

Commit

Permalink
Keep original kind of bundled items.
Browse files Browse the repository at this point in the history
  • Loading branch information
maximebuyse committed Nov 7, 2024
1 parent 4ae9b70 commit 71ce066
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions engine/lib/concrete_ident/concrete_ident.ml
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ module Create = struct
let constructor name =
let path = name.def_id.path @ [ { data = Ctor; disambiguator = 0 } ] in
{ name with def_id = { name.def_id with path } }

let with_kind_of kind_name name = { name with kind = kind_name.kind }
end

let lookup_raw_impl_info (impl : t) : Types.impl_infos option =
Expand Down
4 changes: 4 additions & 0 deletions engine/lib/concrete_ident/concrete_ident.mli
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ module Create : sig
val add_disambiguator : int -> t -> t
(** [add_disambiguator d ident] adds the disambiguator [d] to the last
chunk of [ident]'s path if it holds a string *)

val with_kind_of : t -> t -> t
(** [with_kind_of kind_ident ident] returns [ident] with its kind replaced
by the kind of [kind_ident] *)
end

type view = { crate : string; path : string list; definition : string }
Expand Down
5 changes: 4 additions & 1 deletion engine/lib/dependencies.ml
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,10 @@ module Make (F : Features.T) = struct
(renamings @ variant_and_constructors_renamings)
in
let rename =
let renamer _lvl i = Map.find renamings i |> Option.value ~default:i in
let renamer _lvl i =
Map.find renamings i |> Option.value ~default:i
|> Concrete_ident.Create.with_kind_of i
in
(U.Mappers.rename_concrete_idents renamer)#visit_item ExprLevel
in
shallow_copy rename variants_renamings it
Expand Down

0 comments on commit 71ce066

Please sign in to comment.