Skip to content

Commit

Permalink
Merge PR coq#18511: Forbid opening a functor with Import
Browse files Browse the repository at this point in the history
Reviewed-by: ppedrot
Co-authored-by: ppedrot <ppedrot@users.noreply.github.com>
  • Loading branch information
coqbot-app[bot] and ppedrot committed Jan 19, 2024
2 parents 49680bc + 6b2218f commit b8ba7d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test-suite/bugs/bug_18504.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Module Type SIG.
End SIG.

Fail Module Import A (S:SIG).

Module Type F(X:SIG). End F.

Fail Declare Module Import M : F.

Declare Module M : F.

Fail Module Import N := M.
3 changes: 3 additions & 0 deletions vernac/declaremods.ml
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,9 @@ let start_module_core id args res =
mp, res_entry_o, mbids, sign, args

let start_module export id args res =
let () = if Option.has_some export && not (CList.is_empty args)
then user_err Pp.(str "Cannot import functors.")
in
let fs = Summary.Synterp.freeze_summaries () in
let mp, res_entry_o, mbids, sign, args = start_module_core id args res in
set_openmod_syntax_info { cur_mp = mp; cur_typ = res_entry_o; cur_mbids = mbids };
Expand Down

0 comments on commit b8ba7d6

Please sign in to comment.