mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
use more specific function to get symbols/regions
This commit is contained in:
parent
6ffe14809f
commit
8720462839
2 changed files with 4 additions and 7 deletions
|
@ -1274,7 +1274,7 @@ fn canonicalize_pending_value_def<'a>(
|
||||||
);
|
);
|
||||||
can_defs_by_symbol.insert(symbol, def);
|
can_defs_by_symbol.insert(symbol, def);
|
||||||
} else {
|
} else {
|
||||||
for (_, (symbol, _)) in scope.idents() {
|
for (symbol, _) in scope.symbols() {
|
||||||
if !vars_by_symbol.contains_key(symbol) {
|
if !vars_by_symbol.contains_key(symbol) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1432,7 +1432,7 @@ fn canonicalize_pending_value_def<'a>(
|
||||||
);
|
);
|
||||||
can_defs_by_symbol.insert(symbol, def);
|
can_defs_by_symbol.insert(symbol, def);
|
||||||
} else {
|
} else {
|
||||||
for (_, (symbol, region)) in scope.idents() {
|
for (symbol, region) in scope.symbols() {
|
||||||
if !vars_by_symbol.contains_key(symbol) {
|
if !vars_by_symbol.contains_key(symbol) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,10 +88,6 @@ impl Scope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn idents(&self) -> impl Iterator<Item = (&Ident, &(Symbol, Region))> {
|
|
||||||
self.idents.iter()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn symbols(&self) -> impl Iterator<Item = (&Symbol, &Region)> {
|
pub fn symbols(&self) -> impl Iterator<Item = (&Symbol, &Region)> {
|
||||||
self.symbols.iter()
|
self.symbols.iter()
|
||||||
}
|
}
|
||||||
|
@ -181,7 +177,8 @@ impl Scope {
|
||||||
opt_defined_alias: Option<Region>,
|
opt_defined_alias: Option<Region>,
|
||||||
) -> RuntimeError {
|
) -> RuntimeError {
|
||||||
let opaques_in_scope = self
|
let opaques_in_scope = self
|
||||||
.idents()
|
.idents
|
||||||
|
.iter()
|
||||||
.filter(|(_, (sym, _))| {
|
.filter(|(_, (sym, _))| {
|
||||||
self.aliases
|
self.aliases
|
||||||
.get(sym)
|
.get(sym)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue