Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions parser/src/sema/import_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ impl VisitMut<SemanticAnalysisError> for ImportResolver<'_> {
Ok(value) => value,
Err(err) => return ControlFlow::Break(err),
};
for export in imported_from.exports() {
let name = export.name();
// We fetch the item from the set, rather than simply
// check for containment, because we want the span associated
// with the item in the set, not the span associated with the
// export.
if let Some(item) = items.get(&name) {
self.import(module, *from, *item, export)?;
for item in items.iter() {
match imported_from.get(item) {
Some(export) => {
self.import(module, *from, *item, export)?;
},
None => {
return ControlFlow::Break(SemanticAnalysisError::ImportUndefined(
*from,
));
},
}
}
},
Expand Down