diff --git a/guppylang/std/_internal/util.py b/guppylang/std/_internal/util.py index 746423cb..5afe0f6e 100644 --- a/guppylang/std/_internal/util.py +++ b/guppylang/std/_internal/util.py @@ -80,11 +80,6 @@ def external_op( def op(ty: ht.FunctionType, inst: Inst) -> ops.DataflowOp: concrete_args = [make_concrete_arg(arg, inst, variable_remap) for arg in args] return op_def.instantiate(concrete_args, ty) - return ops.ExtOp( - op_def, - ty, - concrete_args, - ) return op diff --git a/guppylang/tys/builtin.py b/guppylang/tys/builtin.py index 645266db..a022a3b4 100644 --- a/guppylang/tys/builtin.py +++ b/guppylang/tys/builtin.py @@ -136,9 +136,9 @@ def _array_to_hugr(args: Sequence[Argument]) -> ht.Type: # See `ArrayGetitemCompiler` for details. # Same also for classical arrays, see https://github.com/CQCL/guppylang/issues/629 elem_ty = ht.Option(ty_arg.ty.to_hugr()) - - array = hugr.std.collections.array.EXTENSION.get_type("array") - return array.instantiate([len_arg.to_hugr(), ht.TypeTypeArg(elem_ty)]) + hugr_arg = len_arg.to_hugr() + assert isinstance(hugr_arg, ht.BoundedNatArg) + return hugr.std.collections.array.Array(elem_ty, hugr_arg) def _sized_iter_to_hugr(args: Sequence[Argument]) -> ht.Type: