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

Internal error when opening a module inside a constructor #5584

Closed
omelkonian opened this issue Oct 5, 2021 · 3 comments
Closed

Internal error when opening a module inside a constructor #5584

omelkonian opened this issue Oct 5, 2021 · 3 comments
Labels
internal-error Concerning internal errors of Agda let Issues relating to let expressions modules Issues relating to the module system pattern binder Issues with record patterns in binders. regression in 2.6.2 Regression that first appeared in Agda 2.6.2 status: duplicate Duplicate issue (not in changelog)
Milestone

Comments

@omelkonian
Copy link
Contributor

omelkonian commented Oct 5, 2021

This program (artificially produced by minimizing a larger one):

open import Agda.Builtin.Sigma

dup :  {A : Set}  A  Σ A λ _  A
dup x = x , x

postulate
  A : Set

module M {x : A} where
  y = x

data X : Set where
  mkX :  {x : A}
     let
        (_ , _) = dup x
        open M {x}
      in
      X

produces this error:

An internal error has occurred. Please report this as a bug.
Location of the error: __IMPOSSIBLE__, called at src/full/Agda/TypeChecking/Serialise/Instances/Internal.hs:106:26 in Agda-2.6.2-5d92e0bc62f6513c7aa12fd932a1e27cdc986b039aa0267ec831a1bc44eb00c1:Agda.TypeChecking.Serialise.Instances.Internal

Agda version: 2.6.2

@andreasabel andreasabel added let Issues relating to let expressions modules Issues relating to the module system pattern binder Issues with record patterns in binders. internal-error Concerning internal errors of Agda labels Oct 6, 2021
@andreasabel
Copy link
Member

There is an unsolved meta surviving up to serialization, triggering the crash:

icod_ (MetaV a b) = __IMPOSSIBLE__

Could be a duplicate of #5544.

@andreasabel andreasabel added the regression in 2.6.2 Regression that first appeared in Agda 2.6.2 label Oct 6, 2021
@omelkonian
Copy link
Contributor Author

omelkonian commented Oct 11, 2021

Another interesting occurrence with product projections:

open import Data.Product
open import Data.List
open import Agda.Builtin.Equality

postulate A B : Set

module _ (xys : List (A × B)) where
  xs = proj₁ (unzip xys)
  module H (_ : xs ≡ []) where
    i = xs

data X : List A  Set where
  [⊤] :  {xys : List (A × B)}
     let xs = proj₁ (unzip xys) in
      (eq : xs ≡ [])
     let open H xys eq in
      X i

  [⊥] :  {xys : List (A × B)}
     let xs , _ = unzip xys in
      (eq : xs ≡ [])
     let open H xys eq in
      X i

The [⊤] constructor (which uses proj₁) works fine, but the [⊥] constructor (which uses pattern matching in a let instead) leads to the same internal error.

@UlfNorell UlfNorell added the status: duplicate Duplicate issue (not in changelog) label Nov 18, 2021
@UlfNorell
Copy link
Member

This did get fixed by the fix to #5544 so looks like the same problem.

@andreasabel andreasabel added this to the 2.6.2.1 milestone Nov 18, 2021
andreasabel pushed a commit that referenced this issue Nov 19, 2021
closes #5584 which was a the same problem as #5544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal-error Concerning internal errors of Agda let Issues relating to let expressions modules Issues relating to the module system pattern binder Issues with record patterns in binders. regression in 2.6.2 Regression that first appeared in Agda 2.6.2 status: duplicate Duplicate issue (not in changelog)
Projects
None yet
Development

No branches or pull requests

3 participants