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

Support using instances from applied modules in canonicity check #308

Closed
jespercockx opened this issue Mar 22, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jespercockx
Copy link
Member

This is the remaining issue with parametrized modules after the merging of #307:

record Class (a : Set) : Set where
  field
    foo : a  a
open Class {{...}} public
{-# COMPILE AGDA2HS Class class #-}

module M1 (@0 X : Set) where

  instance
    ClassInt : Class Int
    ClassInt .foo = _+ 1
  {-# COMPILE AGDA2HS ClassInt #-}

module M2 (@0 X : Set) where

  open M1 X

  tester : Int
  tester = foo 41
  {-# COMPILE AGDA2HS tester #-}

Error message:

No instance of type M1.Class X Int was found in scope.

The problem is that we are using the instance table of the top-level module rather than the one that was used inside the module M2, and this top-level instance table does not include the instances from locally opened modules. However, I do not know of any way to reconstruct this instance table.

@jespercockx jespercockx added the bug Something isn't working label Mar 22, 2024
@jespercockx jespercockx added this to the 1.4 milestone Mar 22, 2024
jespercockx added a commit to jespercockx/agda-core that referenced this issue Mar 22, 2024
@jespercockx jespercockx modified the milestones: 1.4, 1.3 Sep 25, 2024
@jespercockx
Copy link
Member Author

This issue is no longer there for the new canonicity check.

@jespercockx jespercockx self-assigned this Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant