From bb66d091223f33a3d70789d28b34d03665ee22b6 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Mon, 16 Dec 2024 18:14:40 +0000 Subject: [PATCH] review comments --- guppylang/std/_internal/util.py | 5 ----- guppylang/tys/builtin.py | 5 +++-- 2 files changed, 3 insertions(+), 7 deletions(-) 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..f9785b21 100644 --- a/guppylang/tys/builtin.py +++ b/guppylang/tys/builtin.py @@ -136,9 +136,10 @@ 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()) + hugr_arg = len_arg.to_hugr() - array = hugr.std.collections.array.EXTENSION.get_type("array") - return array.instantiate([len_arg.to_hugr(), ht.TypeTypeArg(elem_ty)]) + # TODO remove type ignore after Array type annotation fixed to include VariableArg + return hugr.std.collections.array.Array(elem_ty, hugr_arg) # type:ignore[arg-type] def _sized_iter_to_hugr(args: Sequence[Argument]) -> ht.Type: