Skip to content

Commit

Permalink
Fix some array op errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Sep 5, 2024
1 parent 5ce13a2 commit 429a9b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion guppylang/prelude/_internal/std_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def new_array(length: int, elem_ty: ht.Type) -> ops.ExtOp:
"""Returns an operation that creates a new fixed length array."""
op_def = hugr.std.PRELUDE.get_op("new_array")
sig = ht.FunctionType([elem_ty] * length, [array_type(length, elem_ty)])
return ops.ExtOp(op_def, sig, [ht.TypeTypeArg(elem_ty)])
return ops.ExtOp(op_def, sig, [ht.BoundedNatArg(length), ht.TypeTypeArg(elem_ty)])


@dataclass
Expand Down
7 changes: 3 additions & 4 deletions tests/integration/modules/mod_b.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Dummy module used in `test_imports.py`"""

from guppylang import GuppyModule, guppy
from guppylang.prelude._internal.util import int_op
from guppylang.prelude._internal.util import unsupported_op

mod_b = GuppyModule("mod_b")

Expand All @@ -11,9 +11,8 @@ def f(x: bool) -> bool:
return not x


@guppy.hugr_op(mod_b, int_op("h", "dummy", 0))
def h() -> int:
...
@guppy.hugr_op(mod_b, unsupported_op("h"))
def h() -> int: ...


@guppy.struct(mod_b)
Expand Down

0 comments on commit 429a9b2

Please sign in to comment.