Skip to content

Commit

Permalink
Add catching on UseOfUndeclaredVariable after lower_path
Browse files Browse the repository at this point in the history
This allows to look for defined constants if no path was found
  • Loading branch information
JulianGCalderon committed May 8, 2024
1 parent 25aad61 commit 6f655d1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/concrete_ir/src/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1480,10 +1480,11 @@ fn lower_value_expr(
(Rvalue::Use(Operand::Const(data)), ty)
}
ValueExpr::ConstStr(_, _) => todo!(),
ValueExpr::Path(info) => {
let (place, place_ty, _span) = lower_path(builder, info)?;
(Rvalue::Use(Operand::Place(place.clone())), place_ty)
}
ValueExpr::Path(info) => match lower_path(builder, info) {
Ok((place, place_ty, _span)) => (Rvalue::Use(Operand::Place(place.clone())), place_ty),
Err(err @ LoweringError::UseOfUndeclaredVariable { .. }) => return Err(err),
Err(err) => return Err(err),
},
})
}

Expand Down

0 comments on commit 6f655d1

Please sign in to comment.