-
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
let: unexpected generalization of variable #5683
Comments
The fix would be to not generalize types if you are already in scope of a generalization. This makes sense I think. |
If you mean the fix is to disallow any (nested) generalization, it might be too limiting. What I would expect is to never re-generalise a variable with the same name. |
I'm not sure it would be that limiting. It's very close to the principle that says we don't generalize the type of _ : (eq : x ≡ x) -> C (x , eq) |
If I understood correctly, the fix would disallow postulate
X : Set
∀≡ : ∀ {x y : X} → x ≡ y
variable x y : X
data C⁻ : (∀ {x : X} → x ≡ x) → Set where
_ :
let
eq : y ≡ y
eq = ∀≡
in
C⁻ eq
data C⁺ : X → (∀ {x : X} → x ≡ x) → Set where
_ :
let
eq : y ≡ y
eq = ∀≡
in
C⁺ x eq |
No I was thinking it would disallow both. The generalization point in both examples would be the top-level type. |
Agda 2.6.2.0.20211129
When using generalized variables in a constructor, I expect to get the same behaviour as if I had explicitly introduced it with a ∀ quantifier.
This breaks by the following MWE:
It seems that the
let
-clause does its own generalization (producingx = # 0
) and shadows the previousx = # 1
.The text was updated successfully, but these errors were encountered: