diff --git a/compiler/frontend/src/lir/body.rs b/compiler/frontend/src/lir/body.rs
index c3926abcc..a63dd93b4 100644
--- a/compiler/frontend/src/lir/body.rs
+++ b/compiler/frontend/src/lir/body.rs
@@ -238,7 +238,7 @@ impl Body {
let range = builder.push(id.to_string(), TokenType::Variable, EnumSet::empty());
builder.push_definition(*id, range);
builder.push(" = ", None, EnumSet::empty());
- expression.build_rich_ir_with_constants(builder, constants);
+ expression.build_rich_ir_with_constants(builder, constants, self);
});
}
}
diff --git a/compiler/frontend/src/lir/constant.rs b/compiler/frontend/src/lir/constant.rs
index 7b7b7e980..90e3951d4 100644
--- a/compiler/frontend/src/lir/constant.rs
+++ b/compiler/frontend/src/lir/constant.rs
@@ -31,6 +31,22 @@ impl Display for ConstantId {
write!(f, "%{}", self.0)
}
}
+impl ConstantId {
+ pub fn build_rich_ir_with_constants(
+ self,
+ builder: &mut RichIrBuilder,
+ constants: impl Into