Skip to content

Commit

Permalink
Do not look up dummy definition
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Oct 16, 2024
1 parent f678380 commit 43358c9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions compiler/noirc_frontend/src/elaborator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::{
stmt::HirStatement,
traits::ResolvedTraitBound,
},
node_interner::DefinitionId,
StructField, TypeBindings,
};
use crate::{
Expand Down Expand Up @@ -458,7 +459,7 @@ impl<'context> Elaborator<'context> {
FunctionKind::Normal | FunctionKind::Recursive => {
self.check_for_unbounded_recursion(
id,
self.interner.definition(func_meta.name.id).name.to_string(),
self.interner.definition_name(func_meta.name.id).to_string(),
func_meta.name.location.span,
hir_func.as_expr(),
);
Expand Down Expand Up @@ -1679,10 +1680,14 @@ impl<'context> Elaborator<'context> {

match self.interner.expression(&expr_id) {
HirExpression::Ident(ident, _) => {
if ident.id == DefinitionId::dummy_id() {
return true;
}
let definition = self.interner.definition(ident.id);
match definition.kind {
DefinitionKind::Function(id) => func_id != id,
_ => true,
if let DefinitionKind::Function(id) = definition.kind {
func_id != id
} else {
true
}
}
HirExpression::Block(b) => check_block(b),
Expand Down

0 comments on commit 43358c9

Please sign in to comment.