import aliases and put them in the scope

This commit is contained in:
Folkert 2020-10-30 19:59:09 +01:00
parent 58467d6515
commit 247071668e
2 changed files with 39 additions and 13 deletions

View file

@ -48,6 +48,7 @@ pub fn canonicalize_module_defs<'a>(
module_ids: &ModuleIds,
exposed_ident_ids: IdentIds,
dep_idents: MutMap<ModuleId, IdentIds>,
aliases: MutMap<Symbol, Alias>,
exposed_imports: MutMap<Ident, (Symbol, Region)>,
mut exposed_symbols: MutSet<Symbol>,
var_store: &mut VarStore,
@ -56,6 +57,10 @@ pub fn canonicalize_module_defs<'a>(
let mut scope = Scope::new(home, var_store);
let num_deps = dep_idents.len();
for (name, alias) in aliases.into_iter() {
scope.add_alias(name, alias.region, alias.vars, alias.typ);
}
// Desugar operators (convert them to Apply calls, taking into account
// operator precedence and associativity rules), before doing other canonicalization.
//