-
Notifications
You must be signed in to change notification settings - Fork 465
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
Mixing binder updates and variable declarations gives confusing errors #2789
Labels
bug
Something isn't working
Comments
1 task
This was referenced Aug 2, 2024
mathlib-bors bot
pushed a commit
to leanprover-community/mathlib4
that referenced
this issue
Aug 7, 2024
Make sure to perform binder annotation updates and declaring new variables in separate variable commands. This is currently recommended because of leanprover/lean4#2789: mixing these can yield confusing errors. Found by a linter in #15400.
bjoernkjoshanssen
pushed a commit
to leanprover-community/mathlib4
that referenced
this issue
Sep 9, 2024
Make sure to perform binder annotation updates and declaring new variables in separate variable commands. This is currently recommended because of leanprover/lean4#2789: mixing these can yield confusing errors. Found by a linter in #15400.
bjoernkjoshanssen
pushed a commit
to leanprover-community/mathlib4
that referenced
this issue
Sep 9, 2024
Make sure to perform binder annotation updates and declaring new variables in separate variable commands. This is currently recommended because of leanprover/lean4#2789: mixing these can yield confusing errors. Found by a linter in #15400.
bjoernkjoshanssen
pushed a commit
to leanprover-community/mathlib4
that referenced
this issue
Sep 12, 2024
Make sure to perform binder annotation updates and declaring new variables in separate variable commands. This is currently recommended because of leanprover/lean4#2789: mixing these can yield confusing errors. Found by a linter in #15400.
Fixed in #5142 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Description
The
variable
command is used both to declare new variables, and to update the binder type (implicit / explicit / instance implicit) of existing variables.Using both features at the same time can produce error messages that advise the user to make things even worse
Context
Zulip thread
Steps to Reproduce
Run the following code
Expected behavior: The
section fails
should either succeed, or it should emit an error message that does not encourage me to writesection bad_advice
. If you put your cursor at theexact
,A
should appear once in the goal view.Actual behavior: The error message tricks me into making a mess of duplicate variables. Putting the cursor at
exact
showsA
twice (as there are two copies!).Versions
4.2.0-rc4 on the web editor
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: