Skip to content

Commit

Permalink
Replace K__ with tuple, more informative
Browse files Browse the repository at this point in the history
  • Loading branch information
msprotz committed Aug 2, 2024
1 parent d43a65c commit 4908abe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Monomorphization.ml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ module NameGen = struct
in
Common.Comment (KPrint.bsprintf "%a" PrintCommon.pdoc comment)

let gen_lid ((m, n) as lid) ts extra =
let gen_lid lid ts extra =
if !short_names then
if lid = tuple_lid && List.for_all ((=) (List.hd ts)) ts then
let n = KPrint.bsprintf "%a_x%d" ptyp (List.hd ts) (List.length ts) in
([], n), [ Common.AutoGenerated ]
else
let m, n = if lid = tuple_lid then [], "tuple" else lid in
let hash = Hashtbl.hash (ts, extra) in
let n = Printf.sprintf "%s_%02x" n (hash land 0xFF) in
let n = Idents.mk_fresh n (fun n -> Hashtbl.mem seen (m, n)) in
Expand Down

0 comments on commit 4908abe

Please sign in to comment.