Skip to content

Commit

Permalink
fix: std.collections.insert wrong output order (#1513)
Browse files Browse the repository at this point in the history
We changed the `Either` type to use the *right* variant to represent
success.

The `insert` operations returns nothing on success, and the element on
error. We had the incorrect order here.
  • Loading branch information
aborgna-q authored Sep 3, 2024
1 parent be9e2be commit 6ab1f75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hugr-core/src/std_extensions/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl ListOp {
insert => self
.list_polytype(
vec![l.clone(), USIZE_T, e.clone()],
vec![l, either_type(Type::UNIT, e).into()],
vec![l, either_type(e, Type::UNIT).into()],
)
.into(),
length => self.list_polytype(vec![l], vec![USIZE_T]).into(),
Expand Down

0 comments on commit 6ab1f75

Please sign in to comment.