-
Notifications
You must be signed in to change notification settings - Fork 323
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
Imported name shadowed by local type not reported #8868
Comments
Moreover, adding
because it also shadows the imported This shadowing also does not issue any error nor warning. I think shadowed symbols (methods and types) should result in a warning. |
According to @4e6 and @JaroslavTulach, type shadowing is perfectly fine. Imagine you would like to define your The type error message is indeed confusing. I will try to improve it. |
Pavel Marek reports a new STANDUP for today (2024-05-03): Progress: - Writing tests and test utilities to create a whole temporary project structure. It should be finished by 2024-05-07. |
That's exactly the rationale behind the If you want to define your own
|
Marking this issue as local.Proj.Mod:
local.Proj.Main:
if we look into the bindings map of Adding this kind of information to the BindingsMap is tracked in #6729 Without this additional information, implementing a static linting compiler pass to detect shadowing of imported symbols is not worth the effort at the moment. Closing the associated PR #9863 with tests and a skeleton of the linting pass. Let's re-open it once we have a better BindingMap. |
Within a project with 2 files:
Mod.enso
and
Main.enso
running
Main.enso
will result in:There's 2 issues here:
A
is shadowed by the type definitiontype A
but this is not reported. If not error, at least a warning should be reported to the user about the shadowing.Type_Error
message is confusing: expected A but got A - ???. The problem is that the qualified name of the types differs. We should record the qualified name of each type and if the short-names are equal, we should display the qualified names to allow the user to disambiguate types with same short names.Tasks
The text was updated successfully, but these errors were encountered: