-
Notifications
You must be signed in to change notification settings - Fork 338
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
Interaction between opaque and instance arguments #6941
Comments
I think I ran into this same on Sunday, but I wrote it off since I was trying to do something stupid anyway. The immediate solution that pops into my head is to fix up the instance canditates according to the following rule: if we have |
Could one instead change instance search so that it never succeeds for opaque symbols? |
Well one could but that solves the problem by denying it exists. A better way might be to ignore all |
The same bug also happens for it : {X : Set} → {{X}} → X
it {{x}} = x
postulate
A : Set
a : A
abstract
B : Set
B = A
instance
b : B
b = a
works : B
works = it
abstract
fails : B
fails = it |
I noticed a rather unfortunate interaction between
opaque
declarations and instance arguments. Consider the following example:works
works, butfails
fails:This is not really surprising given the current implementation of instance search: in this case the instance is attached to the opaque type
B
, but inside the body offails
the type reduces toA
and there are no instances for typeA
in the instance table.I'm not sure what's the best way to solve it, but it feels like we need some kind of
unfolding
-aware instance table. @plt-amy do you have an idea?The text was updated successfully, but these errors were encountered: