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

Metas created during macro execution use the wrong scope #5700

Closed
jespercockx opened this issue Dec 15, 2021 · 0 comments
Closed

Metas created during macro execution use the wrong scope #5700

jespercockx opened this issue Dec 15, 2021 · 0 comments
Assignees
Labels
names reflection Elaborator reflection, macros, tactic arguments type: bug Issues and pull requests about actual bugs ux: printing Issues relating to how terms are printed for display
Milestone

Comments

@jespercockx
Copy link
Member

Here's a small example:

open import Agda.Builtin.List
open import Agda.Builtin.Nat
open import Agda.Builtin.Unit
open import Agda.Builtin.Reflection

pattern vArg x = arg (arg-info visible (modality relevant quantity-ω)) x

macro
  macaroo : Term  TC ⊤
  macaroo hole = unify hole (con (quote suc) (vArg unknown ∷ []))

test : Nat
test = macaroo

When loading this file, you get this:

_n_7 : Agda.Builtin.Nat.Nat  [ at ...:14,8-15 ]

Note that the type of the meta is Agda.Builtin.Nat.Nat, while if you give the term suc _ by hand the type you get is Nat.

@jespercockx jespercockx added type: bug Issues and pull requests about actual bugs reflection Elaborator reflection, macros, tactic arguments ux: printing Issues relating to how terms are printed for display names labels Dec 15, 2021
@jespercockx jespercockx added this to the 2.6.3 milestone Dec 15, 2021
@jespercockx jespercockx self-assigned this Dec 15, 2021
jespercockx added a commit to jespercockx/agda that referenced this issue Dec 15, 2021
jespercockx added a commit to jespercockx/agda that referenced this issue Dec 15, 2021
@andreasabel andreasabel modified the milestones: 2.6.3, 2.6.2.2 Mar 14, 2022
@andreasabel andreasabel mentioned this issue Mar 15, 2022
41 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
names reflection Elaborator reflection, macros, tactic arguments type: bug Issues and pull requests about actual bugs ux: printing Issues relating to how terms are printed for display
Projects
None yet
Development

No branches or pull requests

2 participants