Skip to content

Commit

Permalink
chore: add explanatory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Mar 7, 2024
1 parent aa7f8cc commit 64e5463
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/noirc_frontend/src/hir/def_map/item_scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ impl ItemScope {
if let Entry::Occupied(mut o) = map.entry(name.clone()) {
let trait_hashmap = o.get_mut();
if let Entry::Occupied(mut n) = trait_hashmap.entry(trait_id) {
// Generally we want to reject having two of the same ident in the same namespace.
// The exception to this is when we're explicitly importing something
// which exists in the Noir stdlib prelude.
//
// In this case we ignore the prelude and favour the explicit import.
let is_prelude = std::mem::replace(&mut n.get_mut().2, is_prelude);
let old_ident = o.key();

Expand Down

0 comments on commit 64e5463

Please sign in to comment.