-
Notifications
You must be signed in to change notification settings - Fork 418
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
Resolution with duplicated namespaces #1224
Comments
|
@Vtec234 The behavior is consistent with the spec we have at
It would be great to get community consensus before changing it. |
Oh yes, the import Lean
open Lean Parser Elab Tactic
-- only one of the following works, depending on the order of Parser and Elab!
#check rwRule
#check evalDSimp FWIW, I would have expected Another option that addresses this issue is to reduce the amount of namespaces. I "usually" write |
To be honest, for the longest time I wasn't even aware that, unlike with |
This change seems to have broken a few documentation examples of the form
(which I only found out because I was wondering why the Nix cache was empty 😆 ). |
Not sure I want to open this can of worms right now, but I've wondered before whether |
@Kha I will fix the issue above. |
This commit improves the fix for issue #1224
Description
In the following snippet, should the definition that fails actually succeed in resolving
Bar
?A concrete instance of this occurs with
Lean.Elab.Tactic.Tactic
and a top-levelTactic
namespace defined in mathlib4. Another possible solution to avoid confusion might be toforbid defining symbols with the same name as the innermost namespace, in that namespace. For examplethrow an error when andef Foo.Foo
would be forbiddenopen
statement is ambiguous due to multiple possible namespaces (in this caseFoo.Bar
andBar
) that could be opened.Steps to Reproduce
Expected behavior:
Bar
is resolved in all cases, maybe. I am not certain what namespace resolution should do here.Actual behavior: The first definition fails.
Reproduces how often: 100%
Versions
nightly-2022-06-13
The text was updated successfully, but these errors were encountered: