@@ -717,9 +717,12 @@ let collect_arg_paths mty =
717
717
Path.Set. fold (fun p -> Ident.Set. union (collect_ids ! subst ! bindings p))
718
718
! paths Ident.Set. empty
719
719
720
+ type remove_alias_from =
721
+ | Alias of Ident .t
722
+ | Strengthening
720
723
type remove_alias_args =
721
724
{ mutable modified : bool ;
722
- exclude : Ident .t option -> Path .t -> bool ;
725
+ exclude : remove_alias_from -> Path .t -> bool ;
723
726
scrape : Env .t -> module_type -> module_type }
724
727
725
728
let rec remove_aliases_mty env args pres mty =
@@ -736,7 +739,7 @@ let rec remove_aliases_mty env args pres mty =
736
739
args'.modified < - true ;
737
740
remove_aliases_mty env args' Mp_present mty'
738
741
end
739
- | Mty_strengthen (mty ,p ,Aliasable) when not (args.exclude None p) ->
742
+ | Mty_strengthen (mty ,p ,Aliasable) when not (args.exclude Strengthening p) ->
740
743
let mty = strengthen ~aliasable: false mty p in
741
744
args'.modified < - true ;
742
745
Mp_present , mty
@@ -756,7 +759,7 @@ and remove_aliases_sig env args sg =
756
759
| Sig_module (id , pres , md , rs , priv ) :: rem ->
757
760
let pres, mty =
758
761
match md.md_type with
759
- Mty_alias p when args.exclude (Some id) p ->
762
+ Mty_alias p when args.exclude (Alias id) p ->
760
763
pres, md.md_type
761
764
| mty ->
762
765
remove_aliases_mty env args pres mty
@@ -782,8 +785,8 @@ let scrape_for_type_of ~remove_aliases env mty =
782
785
if remove_aliases then begin
783
786
let excl = collect_arg_paths mty in
784
787
let exclude id _p = match id with
785
- | Some id -> Ident.Set. mem id excl
786
- | None -> false
788
+ | Alias id -> Ident.Set. mem id excl
789
+ | Strengthening -> false
787
790
in
788
791
let scrape _ mty = mty in
789
792
let _, mty =
0 commit comments