-
Notifications
You must be signed in to change notification settings - Fork 453
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
Nested dot notation x.B.C
does not work
#6491
Comments
Thanks for your input. I'd say this isn't a bug (as the behavior is intended by whoever built it), and more a proposal to change the design. |
Given that this is an RFC, I think there needs to be a strong argument why renaming the function to Algorithmically, the full resolution problem suggested in this RFC is When there is ambiguity in dot notation resolution, what takes precedence over what? It's easy to come up with examples where both interpretations
IIRC, the Perhaps |
OK. I find the binary choice between "bug" and "RFC" sometimes a bit inconvenient... |
That looks reasonable to me. |
Never mind, I forgot that |
We discussed this proposal, and decided that although there are use-cases where this would be nice to have, but given the increased complexity (e.g. more ambiguities) we decided to reject this proposal. |
Prerequisites
Please put an X between the brackets as you perform the following steps:
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
If there is a declaration
A.B.C
taking an argument of typeA
andx : A
, thenx.B.C
results in an error.Context
See this thread on Zulip.
This comes up in the context of Mathlib, where, e.g.,
and one would like to write
I.Quotient.mk
whereI : Ideal R
.Steps to Reproduce
Expected behavior:
x.B.C
is interpreted asA.B.C x
.Actual behavior:
An error results.
Versions
4.15.0-rc1 (on (live.lean-lang.org)[https://live.lean-lang.org/#codez=CYUwZgBAghBcEBUCeAHEcC8EByBDALgFCGiRQB0AQuQMIQAUuc0AlM3vphLsQPQC0EAJYA7AG64ANkOAQwQkJNkBySsoA0EfAAt0IcUIBOAexEBbfZ2DGQAZwgjjnAMan8uURGUU1Efr0IQAA9cMxRJdHog5ig2eCCqWggsaNgsQzBJQiA]
Additional Information
May be related to lean4#6400.
In Lean 3, it was possible to write
x^.B.C
to achieve the desired behavior. This does no longer work (and neither doesx.(B.C)
). Couldx.B.C
elaborate asA.B.C x
whenA.B x
does not make sense?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: