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 record declarations, meta variables are messed up #2561

Open
andreasabel opened this issue May 1, 2017 · 2 comments
Open

In record declarations, meta variables are messed up #2561

andreasabel opened this issue May 1, 2017 · 2 comments
Labels
meta Metavariables, insertion of implicit arguments, etc records Record declarations, literals, constructors and updates type: bug Issues and pull requests about actual bugs
Milestone

Comments

@andreasabel
Copy link
Member

andreasabel commented May 1, 2017

data _≡_ {A : Set} (x : A) : A  Set where
  refl : x ≡ x

record _×_ (A B : Set) : Set where
  constructor _,_
  field
    proj₁ : A
    proj₂ : B
open _×_

postulate A : Set

mutual
  record R : Set where

    foo : A  A
    foo = λ x  {!!}

    field bar : A  -- with this field, the meta is not longer solved

    inst :  (p : A × A)  foo (proj₁ p) ≡ proj₁ p
    inst p = refl

Without the field, the meta is solved by ?0 := x. When the field is present, the internal representation of the meta seems to be messed up such that the expandProjectedVar magic no longer works.

  _21 := λ p → refl [blocked on problem 29]
  [29, 32] ?0 (proj₁ p) = proj₁ p : A

This issue should be fixed along with #2500.
Also, the fix for #707 does not do the correct thing for this example (see #2257). However, even if we replace the interaction meta by an underscore, it is not solved in the presence of the field.

@andreasabel andreasabel added type: bug Issues and pull requests about actual bugs meta Metavariables, insertion of implicit arguments, etc records Record declarations, literals, constructors and updates labels May 1, 2017
@UlfNorell
Copy link
Member

Some observations:

Adding another field makes it fail even harder:

record R : Set where

  foo : A  A
  foo = λ x  {!!}

  field bar : A  -- with this field, the meta is not longer solved

  inst :  (p : A × A)  foo (proj₁ p) ≡ proj₁ p
  inst p = refl  -- (proj₁ p) != proj₁ p of type A

  field boo : A

But the corresponding field telescope checks without problems:

no-record : (let foo : A  A; foo = λ x  {!!}) (bar : A)
            (let inst : (p : A × A)  (proj₁ p) ≡ proj₁ p
                 inst = λ p  refl) (boo : A)  A
no-record bar boo = boo

@UlfNorell UlfNorell added this to the 2.5.5 milestone May 31, 2018
@jespercockx
Copy link
Member

This is part of a set of related issues with record types that require a major overhaul of how we handle definitions inside a record module. Attempting a quick fix would likely be a waste of time, so I'm bumping this to the next milestone.

@jespercockx jespercockx modified the milestones: 2.6.0, 2.6.1 Dec 14, 2018
@jespercockx jespercockx modified the milestones: 2.6.1, icebox Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Metavariables, insertion of implicit arguments, etc records Record declarations, literals, constructors and updates type: bug Issues and pull requests about actual bugs
Projects
None yet
Development

No branches or pull requests

3 participants