Skip to content

Commit

Permalink
Fix list to array
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-koch committed Dec 12, 2024
1 parent fbfff57 commit 5ad8fe6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion guppylang/checker/expr_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
float_type,
get_element_type,
int_type,
is_array_type,
is_bool_type,
is_list_type,
is_sized_iter_type,
Expand Down Expand Up @@ -1230,7 +1231,7 @@ def _python_list_to_guppy_type(
# All the list elements must have a unifiable types
v, *rest = vs
elt_hint = (
get_element_type(type_hint) if type_hint and is_list_type(type_hint) else None
get_element_type(type_hint) if type_hint and is_array_type(type_hint) else None
)
el_ty = python_value_to_guppy_type(v, node, globals, elt_hint)
if el_ty is None:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_nats_from_ints(validate):
def foo() -> None:
x: nat = py(1)
y: tuple[nat, nat] = py(2, 3)
z: list[nat] = py([4, 5, 6])
z: array[nat, 3] = py([4, 5, 6])

validate(foo)

Expand Down

0 comments on commit 5ad8fe6

Please sign in to comment.