Skip to content

Commit

Permalink
Use ConstantIndex on array creation
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianGCalderon committed Apr 24, 2024
1 parent 18c15b8 commit e657ebb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/concrete_ir/src/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,9 @@ fn lower_expression(
});

let mut first_place = place.clone();
first_place.projection.push(PlaceElem::Index(first_idx));
first_place
.projection
.push(PlaceElem::ConstantIndex(first_idx as u64));

builder.statements.push(Statement {
span: Some(info.span),
Expand All @@ -984,7 +986,9 @@ fn lower_expression(

for (idx, element) in values {
let mut element_place = place.clone();
element_place.projection.push(PlaceElem::Index(idx));
element_place
.projection
.push(PlaceElem::ConstantIndex(idx as u64));

let (value, _value_ty, _field_span) =
lower_expression(builder, element, Some(element_type.clone()))?;
Expand Down

0 comments on commit e657ebb

Please sign in to comment.