You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This task is automatically imported from the old Task Issue Board and it was originally created by Radosław Waśko.
Original issue is here.
In short, if I have a module F1 defining Fst and in another module do:
import project.F1
export project.F1
from project.F1 export Fst
the identifier Fst will not be exported.
To reproduce the issue create a new project with three files:
F1.enso:
type ISR
Fst
Lst
Whl
F2.enso:
import project.F1
export project.F1
from project.F1 export Fst, Lst
Main.enso:
from Standard.Base import all
from project.F2 import all
main =
IO.println F1
IO.println Fst
When running the project I'd expect output:
F1
Fst
but instead I get:
In module local.Project_123.Main:
Compiler encountered errors:
Main.enso[6:16-6:18]: The name `Fst` could not be found.
Execution finished with an error: Compilation aborted due to errors.
If I remove the line export project.F1 from F2 OR if I move it after the from project.F1 export Fst, I will get:
In module local.Project_123.Main:
Compiler encountered errors:
Main.enso[5:16-5:17]: The name `F1` could not be found.
Execution finished with an error: Compilation aborted due to errors.
So it seems like only one export directive from each module is allowed and all subsequent ones are skipped?
Looks like everything works as expected with F2.enso defined as
import project.F1
import project.F1.ISR
export project.F1
from project.F1.ISR export Fst,Lst
which was needed after the whole change in type semantics (Hubert Plociniczak - Nov 18, 2022)
A slightly modified version of the original description:
`F1.enso`:
```
foo = 42
bar = "z"
```
`F2.enso`:
```
import project.F1
export project.F1
from project.F1 export foo
```
`Main.enso`:
```
from Standard.Base import all
from project.F2 import all
main =
IO.println F1.bar
IO.println foo
This one doesn't work (`foo` is not found). (Hubert Plociniczak - Nov 18, 2022)
<hr />
So the problem is here - https://github.com/enso-org/enso/blob/9361cfe3ffff68b19abab9d333d70e627d8c4cde/engine/runtime/src/main/scala/org/enso/compiler/phase/ImportResolver.scala#L125 we only select a single export with the given name. (Hubert Plociniczak - Nov 18, 2022)
<hr />
**Hubert Plociniczak** reports a new **STANDUP** for the last Friday (2022-11-18):
**Progress:** Investigating the source of the problem of the imports bug. Turns out we explicitly pick the first module export and discard the rest. It should be finished by 2022-11-22.
**Next Day:** Next day I will be working on the [#183092447 task](https://www.pivotaltracker.com/story/show/183092447). Source of the problem is known and reproducible, need to figure out the best way to tackle it. (Enso Bot - Nov 21, 2022)
<hr />
**Hubert Plociniczak** reports a new **STANDUP** for yesterday (2022-11-21):
**Progress:** Working on a fix. Detecting scenarios that can now lead to conflicts when multiple exports are allowed. It should be finished by 2022-11-22.
**Next Day:** Next day I will be working on the [#183092447 task](https://www.pivotaltracker.com/story/show/183092447). Finish tests, create a PR. (Enso Bot - Nov 22, 2022)
<hr />
**Hubert Plociniczak** reports a new **STANDUP** for yesterday (2022-11-22):
**Progress:** Finished the PR, waiting on review. Moved on to #183833055 which has a couple of subtasks. Figured out that 1. will be solved by #183092447. Investigating 2. on how to make extensions methods not to creep into the scope of imports. It should be finished by 2022-11-22.
**Next Day:** Next day I will be working on the [#183833055 task](https://www.pivotaltracker.com/story/show/183833055). Continue on fixing issues with imports. (Enso Bot - Nov 23, 2022)
<hr />
The text was updated successfully, but these errors were encountered:
This task is automatically imported from the old Task Issue Board and it was originally created by Radosław Waśko.
Original issue is here.
In short, if I have a module
F1
definingFst
and in another module do:the identifier
Fst
will not be exported.To reproduce the issue create a new project with three files:
F1.enso
:F2.enso
:Main.enso
:When running the project I'd expect output:
but instead I get:
If I remove the line
export project.F1
fromF2
OR if I move it after thefrom project.F1 export Fst
, I will get:So it seems like only one
export
directive from each module is allowed and all subsequent ones are skipped?Additional Notes
This bug prevented us from exporting
Index_Sub_Range
in one of the PRs, ideally once it is resolved, we should exportIndex_Sub_Range
fromStandard.Base
and then remove the, then obsolete, imports ofimport Standard.Base.Data.Index_Sub_Range
.Comments:
Looks like everything works as expected with F2.enso defined as
which was needed after the whole change in type semantics (Hubert Plociniczak - Nov 18, 2022)
A slightly modified version of the original description: `F1.enso`: ``` foo = 42 bar = "z" ``` `F2.enso`: ``` import project.F1 export project.F1 from project.F1 export foo ``` `Main.enso`: ``` from Standard.Base import all from project.F2 import all
main =
IO.println F1.bar
IO.println foo
The text was updated successfully, but these errors were encountered: