summaryrefslogtreecommitdiff
path: root/parsing/depend.ml
diff options
context:
space:
mode:
authorRichard Eisenberg <reisenberg@janestreet.com>2023-02-12 17:14:12 -0500
committerGitHub <noreply@github.com>2023-02-12 23:14:12 +0100
commit8a61778d2716304203974d20ead1b2736c1694a8 (patch)
treeb57009c340b7ffa0a52390780feb205d200018ef /parsing/depend.ml
parent61f10168da60e94a5f9c2d1ce4cc4e4d512d0007 (diff)
downloadocaml-8a61778d2716304203974d20ead1b2736c1694a8.tar.gz
Add syntax for generative functor application (#11984)
Previously, writing [F ()] was the same as writing [F (struct end)], even though the latter looks like the use of an applicative functor, not a generative one. This commit, originally written by Frédéric Bour <fred@tarides.com>, adds new syntax to our AST to represent generative functor application and propagates this change throughout the compiler. In addition, it adds a new warning, 73, to report when a user has written [F (struct end)] but should now update to [F ()]. Co-authored-by: Frédéric Bour <fred@tarides.com>
Diffstat (limited to 'parsing/depend.ml')
-rw-r--r--parsing/depend.ml7
1 files changed, 5 insertions, 2 deletions
diff --git a/parsing/depend.ml b/parsing/depend.ml
index 55b4f410cd..a07cb1dce7 100644
--- a/parsing/depend.ml
+++ b/parsing/depend.ml
@@ -436,8 +436,11 @@ and add_module_expr bv modl =
| Some name -> String.Map.add name bound bv
in
add_module_expr bv modl
- | Pmod_apply(mod1, mod2) ->
- add_module_expr bv mod1; add_module_expr bv mod2
+ | Pmod_apply (mod1, mod2) ->
+ add_module_expr bv mod1;
+ add_module_expr bv mod2
+ | Pmod_apply_unit mod1 ->
+ add_module_expr bv mod1
| Pmod_constraint(modl, mty) ->
add_module_expr bv modl; add_modtype bv mty
| Pmod_unpack(e) ->