Skip to content

Commit ecd771a

Browse files
committed
avoid unintended module type name conflict
1 parent 3b13782 commit ecd771a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jscomp/frontend/bs_builtin_ppx.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ let local_module_type_name =
444444
let v = ref 0 in
445445
fun ({ txt } : Longident.t Location.loc) ->
446446
incr v;
447-
(Longident.flatten txt |> List.fold_left (fun ll l -> ll ^ l) "")
448-
^ string_of_int !v
447+
"__" ^ (Longident.flatten txt |> List.fold_left (fun ll l -> ll ^ l) "")
448+
^ string_of_int !v ^ "__"
449449

450450
let expand_reverse (stru : Ast_structure.t) (acc : Ast_structure.t) :
451451
Ast_structure.t =
@@ -526,7 +526,7 @@ let rec structure_mapper (self : mapper) (stru : Ast_structure.t) =
526526
{ txt = safe_module_type_name; loc }
527527
~typ:(Mty.typeof_ ~loc me))
528528
in
529-
(* module BeltList0 = module type of Belt.List *)
529+
(* module __BeltList1__ = module type of Belt.List *)
530530
module_type_decl
531531
:: {
532532
item with

0 commit comments

Comments
 (0)