Skip to content

Commit

Permalink
Merge branch 'coq-8.17' into coq-8.18
Browse files Browse the repository at this point in the history
  • Loading branch information
mattam82 committed Mar 18, 2024
2 parents 05cffdf + 8a42c5b commit 65f3a82
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
5 changes: 3 additions & 2 deletions template-coq/src/g_template_coq.mlg
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ END
VERNAC COMMAND EXTEND TemplateCoq_Run_Template_Program CLASSIFIED AS SIDEFF STATE program
| #[ poly = polymorphic ] [ "MetaCoq" "Run" constr(def) ] ->
{ fun ~pm -> let (env, evm) = fresh_env () in
let (evm, def) = Constrintern.interp_open_constr env evm def in
let pgm = to_constr_evars evm def in
let (pgm, ctx) = Constrintern.interp_constr env evm def in
let evm = Evd.from_ctx ctx in
let pgm = EConstr.to_constr ~abort_on_undefined_evars:true evm pgm in
run_template_program ~pm env evm ~poly pgm }
END

Expand Down
28 changes: 28 additions & 0 deletions test-suite/issue1042.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From MetaCoq.Utils Require Import utils.
From MetaCoq.Template Require Import All.
Import MCMonadNotation.


(*Exemple with a typing error*)
Definition ident_term (a : term) : term := a.

Definition quote_inductive {X}(inductive:X): TemplateMonad _ :=
quote <- tmQuote inductive;;
tmReturn quote.

Inductive tm : Set := .

Definition d1 : TemplateMonad unit.
(* Set Debug "backtrace". *)
Fail MetaCoq Run(
quote <- quote_inductive tm;;
constructor <- ident_term quote;;
tmPrint constructor)
.
Fail run_template_program (quote <- quote_inductive tm;;
constructor <- ident_term quote;;
tmPrint constructor) ltac:(fun x => idtac).
Fail refine (
quote <- quote_inductive tm;;
constructor <- ident_term quote;;
tmPrint constructor).

0 comments on commit 65f3a82

Please sign in to comment.