From 6ab1f75770481d867ee10dbe5a1cfa912424ae2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= <121866228+aborgna-q@users.noreply.github.com> Date: Tue, 3 Sep 2024 15:07:21 +0100 Subject: [PATCH] fix: `std.collections.insert` wrong output order (#1513) 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. --- hugr-core/src/std_extensions/collections.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hugr-core/src/std_extensions/collections.rs b/hugr-core/src/std_extensions/collections.rs index 5900df4ef..270f234b6 100644 --- a/hugr-core/src/std_extensions/collections.rs +++ b/hugr-core/src/std_extensions/collections.rs @@ -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(),