-
Notifications
You must be signed in to change notification settings - Fork 339
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 in Agda.TypeChecking.MetaVars #5565
Comments
Agda 2.6.0 and 2.6.1 give a proper error with a suggestion to work around:
So it is a regression in 2.6.2. |
Ping @jespercockx. |
The error location points to the line saying the following: Dummy s _ -> __IMPOSSIBLE_VERBOSE__ s Shouldn't this also print the string with the location where the dummy was created? Or do I not understand how |
Ah apparently I need to add
|
Yeah, I often fall for this trap, too. |
@jespercockx : Any chance we get this fixed for 2.6.2.1? |
I'll give it a look |
Here is my analysis of the problem:
So the root cause of the problem is the presence of a dummy in the type of the argument of One reasonably principled way to solve this would be to prune the dependencies on the |
This sounds bad to me. |
Note that this problem only occurs when there are unsolved sort metas in the type of a generalizable variable, in which case you would anyway get a warning. For example, the problem I was thinking of could occur when you write the following: variable
T : Set _ → _ Here the sort of the codomain of The worst that could happen because of this in theory is that you get a hard error where you should only get unsolved constraints. However, even this situation seems hard to engineer, as generalization only happens when there are no unsolved constraints. For example, when we write this: postulate
f : ∀ {ℓ} → (Set ℓ → Set ℓ) → Set
test : f T Agda does not throw a hard error, even though the codomain of Maybe someone smarter than I can come up with an example where things do go wrong, but even then it would only be when you use a generalizable variable with an unsolved sort meta in its type (and you will also still see the warning "Cannot generalize over unsolved sort metas"), so I do not think this is a very serious problem. |
OK. I would be more concerned if there was a situation in which Agda accepted some code which should contain unsolved metavariables. With a complicated unification algorithm such as Agda's I think it is nice if one can say that, if some code is accepted, and a person reading the code can correctly identify one way to instantiate the meta-variables, then this must be the way in which the meta-variables were instantiated. |
Version:
2.6.3-20974a8
Code:
Output:
UPDATE (Andreas): This is here:
agda/src/full/Agda/TypeChecking/MetaVars.hs
Line 1640 in 52702c9
The text was updated successfully, but these errors were encountered: