Skip to content

Commit

Permalink
Sanity check that the GlobalId and the definition are the same
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Oct 11, 2024
1 parent 6e02230 commit 1d2bd36
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/noirc_frontend/src/elaborator/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ impl<'context> Elaborator<'context> {
(_, other) => other,
};
let ident = if let Some(global_id) = global_id {
// Sanity check that we don't have conflicting globals.
assert_eq!(definition, DefinitionKind::Global(global_id));
// Globals don't need to be added to scope, they're already in the def_maps
let id = self.interner.get_global(global_id).definition_id;
let location = Location::new(name.span(), self.file);
Expand Down

0 comments on commit 1d2bd36

Please sign in to comment.