summaryrefslogtreecommitdiff
path: root/typing/tast_mapper.ml
diff options
context:
space:
mode:
Diffstat (limited to 'typing/tast_mapper.ml')
-rw-r--r--typing/tast_mapper.ml22
1 files changed, 8 insertions, 14 deletions
diff --git a/typing/tast_mapper.ml b/typing/tast_mapper.ml
index bd46e0594f..c288345e92 100644
--- a/typing/tast_mapper.ml
+++ b/typing/tast_mapper.ml
@@ -426,6 +426,10 @@ let signature_item sub x =
let class_description sub x =
class_infos sub (sub.class_type sub) x
+let functor_parameter sub = function
+ | Unit -> Unit
+ | Named (id, s, mtype) -> Named (id, s, sub.module_type sub mtype)
+
let module_type sub x =
let mty_env = sub.env sub x.mty_env in
let mty_desc =
@@ -433,13 +437,8 @@ let module_type sub x =
| Tmty_ident _
| Tmty_alias _ as d -> d
| Tmty_signature sg -> Tmty_signature (sub.signature sub sg)
- | Tmty_functor (id, s, mtype1, mtype2) ->
- Tmty_functor (
- id,
- s,
- Option.map (sub.module_type sub) mtype1,
- sub.module_type sub mtype2
- )
+ | Tmty_functor (arg, mtype2) ->
+ Tmty_functor (functor_parameter sub arg, sub.module_type sub mtype2)
| Tmty_with (mtype, list) ->
Tmty_with (
sub.module_type sub mtype,
@@ -484,13 +483,8 @@ let module_expr sub x =
match x.mod_desc with
| Tmod_ident _ as d -> d
| Tmod_structure st -> Tmod_structure (sub.structure sub st)
- | Tmod_functor (id, s, mtype, mexpr) ->
- Tmod_functor (
- id,
- s,
- Option.map (sub.module_type sub) mtype,
- sub.module_expr sub mexpr
- )
+ | Tmod_functor (arg, mexpr) ->
+ Tmod_functor (functor_parameter sub arg, sub.module_expr sub mexpr)
| Tmod_apply (mexp1, mexp2, c) ->
Tmod_apply (
sub.module_expr sub mexp1,