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(),