Skip to content
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

Ambiguous symbol import error is too restrictive #6985

Closed
Akirathan opened this issue Jun 7, 2023 · 2 comments
Closed

Ambiguous symbol import error is too restrictive #6985

Akirathan opened this issue Jun 7, 2023 · 2 comments
Assignees
Labels
--bug Type: bug -compiler -libs Libraries: New libraries to be implemented

Comments

@Akirathan
Copy link
Member

PR #6868 introduces an ambiguous symbol import error that is thrown once some import statement imports a symbol that has already been imported by a different import and points to a different entity. This seems too restrictive. We should report this error only if the symbol is used.

The following example unnecessarily results in an ambiguous symbol import error:
Lib1/src/Main.enso:

type S
export project.S

Lib2/src/Main.enso:

type S
export project.S

New_Project/Main.enso:

from Lib1 import all
from Lib2 import all

# Never use symbol S

Currently, this will result in a compiler error about ambiguous symbol S - this first import points to Lib1.S and the second one to Lib2.S. This is too restrictive. We want to defer this error until the symbol S is actually used for the first time.

Currently, both our Standard.Base and Standard.Table have Data directories that can potentially be exported. If they are exported, we will have this ambiguous error.

The solution should probably be to modify AliasAnalysis to include symbols from imports. More specifically, to attach metadata to imported symbols?

@Akirathan Akirathan added --bug Type: bug -compiler -libs Libraries: New libraries to be implemented labels Jun 7, 2023
@Akirathan Akirathan self-assigned this Jun 7, 2023
@github-project-automation github-project-automation bot moved this to ❓New in Issues Board Jun 7, 2023
@jdunkerley jdunkerley moved this from ❓New to 📤 Backlog in Issues Board Jun 13, 2023
@JaroslavTulach
Copy link
Member

Don't we have hidding to resolve the clashes?

@Akirathan
Copy link
Member Author

Don't we have hidding to resolve the clashes?

@JaroslavTulach Yes. hiding is an obvious fix. Closing this issue as not relevant at the moment.

@github-project-automation github-project-automation bot moved this from 📤 Backlog to 🟢 Accepted in Issues Board Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -compiler -libs Libraries: New libraries to be implemented
Projects
Archived in project
Development

No branches or pull requests

2 participants