-
Notifications
You must be signed in to change notification settings - Fork 432
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
Default values lost for structure fields with types dependent on parent structures #2186
Closed
1 task done
Comments
Minimized further: structure A (α : Type u) where
p : Prop
bar : p → True
structure B (α : Type _) extends A α where
bar _ := trivial
-- Doesn't work without specifying bar
example : B α where
p := False I don't know if this represents the entire issue yet. |
kmill
added a commit
that referenced
this issue
Oct 25, 2024
…nce notation A step of expanding structure instances is to determine all the default values, and part of this is reducing projections that appear in the default values so that they get replaced with the user-provided values. Binder types in foralls, lambdas, and lets have to be reduced to. Closes #2186
github-merge-queue bot
pushed a commit
that referenced
this issue
Oct 26, 2024
…nce notation (#5844) A step of expanding structure instances is to determine all the default values, and part of this is reducing projections that appear in the default values so that they get replaced with the user-provided values. Binder types in foralls, lambdas, and lets have to be reduced too. Closes #2186
tobiasgrosser
pushed a commit
to opencompl/lean4
that referenced
this issue
Oct 27, 2024
…nce notation (leanprover#5844) A step of expanding structure instances is to determine all the default values, and part of this is reducing projections that appear in the default values so that they get replaced with the user-provided values. Binder types in foralls, lambdas, and lets have to be reduced too. Closes leanprover#2186
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Description
Expected behavior: the
bar
field is filled with the default supplied in the definition ofE
. However, it is not.Reproduces how often: 100%
Versions
nightly-2023-04-07 (commit 9aeae67)
Additional Information
This seems to be related to the fact that the type of
bar
depends onLE α
/X α
.In fact, in my original code involving
Preorder α
rather thanLE α
(which I was not able to reduce to a reproducible small test case), constructing thePreorder
instance first withhave : Preorder α := { ... }; { ... }
allowed the field to be inferred.The text was updated successfully, but these errors were encountered: