Skip to content

Commit

Permalink
better error message
Browse files Browse the repository at this point in the history
Co-authored-by: Agustín Borgna <[email protected]>
  • Loading branch information
ss2165 and aborgna-q authored Jun 21, 2024
1 parent 5b80dd5 commit 5b3319e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hugr-py/src/hugr/_dfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def call(
case FunctionKind(sig):
signature = sig
case _:
raise ValueError(f"Expected function type, got {f_kind}")
raise ValueError(f"Expected 'func' to be a function")

Check warning on line 181 in hugr-py/src/hugr/_dfg.py

View check run for this annotation

Codecov / codecov/patch

hugr-py/src/hugr/_dfg.py#L180-L181

Added lines #L180 - L181 were not covered by tests
call_op = ops.Call(signature, instantiation, type_args)
call_n = self.hugr.add_node(call_op, self.parent_node, call_op.num_out)
self.hugr.add_link(func.out(0), call_n.inp(call_op.function_port_offset()))
Expand Down

0 comments on commit 5b3319e

Please sign in to comment.