enso-org / enso

Hybrid visual and textual functional programming.
https://enso.org
Apache License 2.0
7.31k stars 318 forks source link

Import resolver should be capable of resolving also methods and constructors #6729

Open Akirathan opened 1 year ago

Akirathan commented 1 year ago

ImportResolver is incapable of resolving symbols within from ... import symbol_1, symbol_2, ... statements. We should provide another compiler step to resolve these symbols, along with symbols from all import statements like from Module.Type import all (which should collect all the constructors), etc. The step should update BindingMap with the additional information.

There is an abandoned PR that adds this functionality - #6457. Before this PR will be integrated, we should think over the architecture of current BindingMap - it is currently modified in-place from many places, which is potentially dangerous, especially because BindingMap is serializable, and it is cached.

Related:

### Tasks
- [ ] Enable/add all the tests from https://github.com/enso-org/enso/pull/6457/files#diff-de25bd229c75933a6fb950d1d00d8dfcca100058614c230de09c32aac7479816
- [ ] Revert https://github.com/enso-org/enso/pull/6726/commits/5595728f39fd50b4aca845d7778415dd3ed09beb
Akirathan commented 2 months ago

This issue blocks https://github.com/enso-org/enso/pull/9692#discussion_r1574540915 - private check cannot throw a compiler error when accessing private constructors or private methods.