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

Unifier can use erased variables in non-erased data parameters #5191

Closed
andy-morris opened this issue Feb 9, 2021 · 2 comments · Fixed by #5366
Closed

Unifier can use erased variables in non-erased data parameters #5191

andy-morris opened this issue Feb 9, 2021 · 2 comments · Fixed by #5366
Assignees
Labels
erasure type: bug Issues and pull requests about actual bugs
Milestone

Comments

@andy-morris
Copy link

andy-morris commented Feb 9, 2021

In the following code, I would expect there to be an unsolved meta for x in 0-to-ω's rhs, but it is accepted in 2.6.1.2 and in current master.

data _≡⁰_ {A : Set} (@0 x : A) : @0 A  Set where refl : x ≡⁰ x
data _≡ʷ_ {A : Set} (@ω x : A) : @ω A  Set where refl : x ≡ʷ x

0-to-ω :  {A} {@0 x y : A}  x ≡⁰ y  x ≡ʷ y
0-to-ω refl = refl
  -- rejected if hidden args are given explicitly,
  -- which is what I was expecting
-- 0-to-ω {x = x} refl = refl {x = {!x!}}

If I remember correctly, constructors don't actually contain the datatype's parameters, which I suppose is probably why this happens? (Changing the x parameters to indices results in the unsolved meta in 0-to-ω that I was expecting.) But either way it seems strange that one clause is accepted and the other isn't.

Sorry if this is a duplicate of 4727, or if I am misunderstanding something and it's not a bug at all.

@nad
Copy link
Contributor

nad commented Feb 9, 2021

But either way it seems strange that one clause is accepted and the other isn't.

I agree. If we decide to make the parameters erased in the types of constructors (#4786), then this problem would presumably go away.

@nad nad added erasure status: blocked-by-issue This pull request is blocked on an open issue. type: bug Issues and pull requests about actual bugs labels Feb 9, 2021
@nad nad added this to the 2.6.3 milestone Feb 9, 2021
nad added a commit that referenced this issue Oct 20, 2021
This also fixes issue #5191.
@nad
Copy link
Contributor

nad commented Oct 20, 2021

It does.

@nad nad self-assigned this Oct 20, 2021
@nad nad linked a pull request Oct 20, 2021 that will close this issue
nad added a commit that referenced this issue Oct 20, 2021
This also fixes issue #5191.
nad added a commit that referenced this issue Oct 20, 2021
This also fixes issue #5191.
nad added a commit that referenced this issue Oct 21, 2021
This also fixes issue #5191.
@nad nad closed this as completed in #5366 Oct 21, 2021
nad added a commit that referenced this issue Oct 21, 2021
This also fixes issue #5191.
@nad nad removed the status: blocked-by-issue This pull request is blocked on an open issue. label Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
erasure type: bug Issues and pull requests about actual bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants