mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Fix package module resolution in inline imports
We were still passing `ModuleIds` from `load` to `can`, but now that imports can appear in any scope, we don't know which package an unqualified module name belongs to from the top level. We now pass `PackageModuleIds` instead and keep a Map of `ModuleName` to `ModuleId` in `Scope`. This also allow us to import multiple modules with the same name from different packages as long as a unique alias is provided.
This commit is contained in:
parent
842a256907
commit
1f347f6ca1
13 changed files with 398 additions and 309 deletions
|
@ -198,6 +198,7 @@ pub struct ParsedModule<'a> {
|
|||
pub packages: MutMap<&'a str, PackageName<'a>>,
|
||||
pub initial_scope: MutMap<Ident, (Symbol, Region)>,
|
||||
pub exposes: Vec<Symbol>,
|
||||
pub opt_shorthand: Option<&'a str>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue