-
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
Don't rename imported Main module that only imports names #3710
Conversation
@JaroslavTulach I don't think @kazcw needs to be aware of this one. This is added in a later compiler phase. Current parser gives correct IR. |
engine/runtime/src/test/scala/org/enso/compiler/test/pass/desugar/ImportsTest.scala
Show resolved
Hide resolved
/cc @jdunkerley since you discovered it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technical approval - I find the import system of Enso too confusing to judge what is right or wrong.
aad5647
to
e936ef4
Compare
e936ef4
to
ea1ef9f
Compare
Btw. after we made it so that |
@radeusgd I'll be removing that syntax from the new parser, discussion here: #3710 (comment) |
98ac4b8
to
0c979cf
Compare
Turns that if you import a two-part import we had special code that would a) add Main submodule b) add an explicit rename. b) is problematic because sometimes we only want to import specific names. E.g., ``` from Bar.Foo import Bar, Baz ``` would be translated to ``` from Bar.Foo.Main as Foo import Bar, Baz ``` and it should only be translated to ``` from Bar.Foo.Main import Bar, Baz ``` This change detects this scenario and does not add renames in that case.
Don't add rename when importing/exporting all names as well.
We now require those to be written by hand.
0c979cf
to
2399827
Compare
Pull Request Description
Turns that if you import a two-part import we had special code that would a) add Main submodule b) add an explicit rename.
b) is problematic because sometimes we only want to import specific names.
E.g.,
would be translated to
and it should only be translated to
This change detects this scenario and does not add renames in that case.
Fixes 183276486.
Checklist
Please include the following checklist in your PR:
Scala,
Java,
and
Rust
style guides.
./run ide build
and./run ide watch
.