diff options
author | Richard Eisenberg <reisenberg@janestreet.com> | 2023-02-12 17:14:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-12 23:14:12 +0100 |
commit | 8a61778d2716304203974d20ead1b2736c1694a8 (patch) | |
tree | b57009c340b7ffa0a52390780feb205d200018ef /parsing/parsetree.mli | |
parent | 61f10168da60e94a5f9c2d1ce4cc4e4d512d0007 (diff) | |
download | ocaml-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/parsetree.mli')
-rw-r--r-- | parsing/parsetree.mli | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/parsing/parsetree.mli b/parsing/parsetree.mli index d0e64bd4fd..80a796befd 100644 --- a/parsing/parsetree.mli +++ b/parsing/parsetree.mli @@ -960,7 +960,8 @@ and module_expr_desc = | Pmod_structure of structure (** [struct ... end] *) | Pmod_functor of functor_parameter * module_expr (** [functor(X : MT1) -> ME] *) - | Pmod_apply of module_expr * module_expr (** [ME1(ME2)] *) + | Pmod_apply of module_expr * module_expr (** [ME1(ME2)] *) + | Pmod_apply_unit of module_expr (** [ME1()] *) | Pmod_constraint of module_expr * module_type (** [(ME : MT)] *) | Pmod_unpack of expression (** [(val E)] *) | Pmod_extension of extension (** [[%id]] *) |