extends
generates non ctrl+clickable constants, causing ctrl+click to lead to the wrong definition
#4649
Closed
3 tasks done
Labels
bug
Something isn't working
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
When using the
extends
keyword for defining classes, the generated projection function is not ctrl-clickable. This can cause ctrl+clicking on the constant to lead to the definition of a different constant.Context
I was ctrl+clicking on type class projection functions, and got really confused, because it went to the wrong definition.
Steps to Reproduce
Minimal example:
In this code, put the cursor on either
i.toA
, or(inferInstance : B 4).toA
. Then go to the infoview and ctrl+click on.toA
.Expected behavior: [Clear and concise description of what you expect to happen]
ctrl+click on
.toA
leads to the definition ofclass B
.Actual behavior: [Clear and concise description of what actually happens]
ctrl+click at
i.toA
doesn't work.ctrl+click at
(inferInstance : B 4).toA
leads to the definition ofinstance instOfNatNat
.Versions
4.11.0-nightly-2024-07-03
Additional Information
[Additional information, configuration or data that might be necessary to reproduce the issue]
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: