Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In 8.18, MetaCoq Run sometimes returns an anomaly when running incorrectly typed code. #1042

Closed
DeLectionnes opened this issue Jan 22, 2024 · 1 comment

Comments

@DeLectionnes
Copy link

In 8.18, MetaCoq Run sends an anomaly if you Run a piece of code that is not typed correctly, and that the Coq typechecker rejects.

In 8.16, it only sends an error, not an anomaly.

This happens with the version 1.2.1+8.18 installed via opam.

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.
Fail refine (
    quote  <- quote_inductive tm;;
    constructor <- ident_term quote;;
    tmPrint constructor)
.
(*The command has indeed failed with message:
In environment
quote : term
Unable to unify "term" with "TemplateMonad ?Goal2".
(while solving unification constraints, see flag "Solve Unification Constraints")*)
Abort.

Fail MetaCoq Run(
    quote  <- quote_inductive tm;;
    constructor <- ident_term quote;;
    tmPrint constructor)
.
(*Error: Anomaly "File "kernel/constr.ml", line 1485, characters 26-32: Assertion failed."
Please report at http://coq.inria.fr/bugs/.*)
``
mattam82 added a commit that referenced this issue Mar 15, 2024
Fix issue #1042 MetaCoq Run does not support evars.
@mattam82
Copy link
Member

Fixed in #1068 and released in 1.3.1 versions (soon in opam)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants