Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions compiler/noirc_frontend/src/elaborator/scope.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Lexical scoping, variable lookup, and closure capture tracking.

use crate::ast::{ERROR_IDENT, Ident};
use crate::elaborator::path_resolution::PathResolution;
use crate::hir::def_map::{LocalModuleId, ModuleId};

use crate::hir::scope::{Scope as GenericScope, ScopeTree as GenericScopeTree};
Expand Down Expand Up @@ -226,8 +227,9 @@ impl Elaborator<'_> {
path: TypedPath,
mode: PathResolutionMode,
) -> Option<Shared<TypeAlias>> {
match self.resolve_path_or_error_inner(path, PathResolutionTarget::Type, mode) {
Ok(PathResolutionItem::TypeAlias(type_alias_id)) => {
match self.resolve_path_inner(path, PathResolutionTarget::Type, mode) {
Ok(PathResolution { item: PathResolutionItem::TypeAlias(type_alias_id), errors }) => {
self.push_errors(errors);
Some(self.interner.get_type_alias(type_alias_id))
}
_ => None,
Expand Down
8 changes: 5 additions & 3 deletions compiler/noirc_frontend/src/elaborator/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
AsTraitPath, BinaryOpKind, GenericTypeArgs, Ident, PathKind, UnaryOp, UnresolvedType,
UnresolvedTypeData, UnresolvedTypeExpression, WILDCARD_TYPE,
},
elaborator::UnstableFeature,
elaborator::{UnstableFeature, path_resolution::PathResolution},
hir::{
def_collector::dc_crate::CompilationError,
def_map::{ModuleDefId, fully_qualified_module_path},
Expand Down Expand Up @@ -619,8 +619,10 @@ impl Elaborator<'_> {
}

// If we cannot find a local generic of the same name, try to look up a global
match self.resolve_path_or_error_inner(path.clone(), PathResolutionTarget::Value, mode) {
Ok(PathResolutionItem::Global(id)) => {
match self.resolve_path_inner(path.clone(), PathResolutionTarget::Value, mode) {
Ok(PathResolution { item: PathResolutionItem::Global(id), errors }) => {
self.push_errors(errors);

if let Some(current_item) = self.current_item {
self.interner.add_global_dependency(current_item, id);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading