-
Notifications
You must be signed in to change notification settings - Fork 435
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
#eval
: kernel declaration has metavariables
#898
Comments
|
@Kha ah, but why does |
The output universe of
@leodemoura What do you think? I think I'll leave the two last ones to you if you agree. |
@Kha Ah, sounds good. I am surprised that |
I think that's because |
It's certainly not common by any means, but it does happen in cardinals/ordinals. By "introducing an explicit universe variable", do you mean IMHO |
You would still need to reference the new variables in the body to escape the new check, as in
Ooh, I like it. |
And since they are no longer metavariables, they escape the check anyhow? def test := generate.{_, u} 0 (∙ + 1) |> array (I don't think it would cause huge issues to forbid the above as well.) Another option to avoid unexpected universe parameters is to instantiate all universe metavariables that only occur in the body by 0. |
Hmm, intriguing. We can't claim parametricity over universes because TC resolution and other parts can distinguish them, but in practice it really shouldn't matter. |
I agree.
The two options above look reasonable to me. The second is more convenient for users but I wonder whether it will confuse users or not. I think the first option may be helpful to expose issues in the definition. |
The original issue has been fixed, but the other suggestion has not been implemented.
|
In my experience, whenever this happens it is a bug, and tracking it down is tricky since universes are so thoroughly hidden most of the time, so the errors can persist for a while. I'm fully in support of not letting def bodies have free universe metavariables not determined by the type. |
…arameter that does not occur in the declaration type nor is explicitly provided closes #898
Prerequisites
Description
A code sample using
#eval
produces(kernel) declaration has metavariables '_eval'
when the evaluated term has a type with no metavariables.Steps to Reproduce
Expected behavior:
For the
#eval
to succeed (in this case, loop indefinitely).Actual behavior:
Get a metavariable error for a term whose type has no metavariables.
Reproduces how often:
Always.
Versions
Windows 10 20H2
Lean (version 4.0.0-nightly-2021-12-17, commit e65f3fe81032, Release)
Additional Information
None.
The text was updated successfully, but these errors were encountered: