-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Generating guppy (v0.17):
@guppy
def bar(x: int) -> int:
return x
@guppy
@no_type_check
def foo(f: Callable[[int], int], y: int) -> int:
return f(y)
@guppy
@no_type_check
def main() -> None:
foo(bar, 1)
Error (port number is too high):
---- force_order::test::call_indirect_bug stdout ----
thread 'force_order::test::call_indirect_bug' panicked at hugr-core/src/hugr/hugrmut.rs:372:9:
Received an invalid port Port(Incoming, 3) for node Node(18) while mutating a HUGR:
stack backtrace:
0: rust_begin_unwind
at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:692:5
1: core::panicking::panic_fmt
at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:75:14
2: hugr_core::hugr::hugrmut::panic_invalid_port
at /Users/seyon/ng/hugr/hugr-core/src/hugr/hugrmut.rs:627:9
3: <T as hugr_core::hugr::hugrmut::HugrMut>::connect
at /Users/seyon/ng/hugr/hugr-core/src/hugr/hugrmut.rs:372:9
4: hugr_passes::force_order::force_order_by_key
at ./src/force_order.rs:92:17
5: hugr_passes::force_order::force_order
at ./src/force_order.rs:44:5
6: hugr_passes::force_order::test::call_indirect_bug
at ./src/force_order.rs:347:9
7: hugr_passes::force_order::test::call_indirect_bug::{{closure}}
at ./src/force_order.rs:333:27
8: core::ops::function::FnOnce::call_once
at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/ops/function.rs:250:5
9: core::ops::function::FnOnce::call_once
at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/ops/function.rs:250:5
graph LR
subgraph 0 ["(0) Module"]
direction LR
subgraph 1 ["(1) FuncDefn: #quot;bar#quot;"]
direction LR
2["(2) Input"]
3["(3) Output"]
subgraph 4 ["(4) CFG"]
direction LR
subgraph 5 ["(5) DataflowBlock"]
direction LR
6["(6) Input"]
7["(7) Output"]
9["(9) Tag"]
6--"0:1<br>int(6)"-->7
6-."1:0".->9
9--"0:0<br>Unit"-->7
end
8["(8) ExitBlock"]
5-."0:0".->8
end
2--"0:0<br>int(6)"-->4
4--"0:0<br>int(6)"-->3
end
subgraph 10 ["(10) FuncDefn: #quot;foo#quot;"]
direction LR
11["(11) Input"]
12["(12) Output"]
subgraph 13 ["(13) CFG"]
direction LR
subgraph 14 ["(14) DataflowBlock"]
direction LR
15["(15) Input"]
16["(16) Output"]
18["(18) CallIndirect"]
19["(19) Tag"]
15--"0:0<br>[int(6)] -> [int(6)]"-->18
15--"1:1<br>int(6)"-->18
15-."2:0".->19
18--"0:1<br>int(6)"-->16
19--"0:0<br>Unit"-->16
end
17["(17) ExitBlock"]
14-."0:0".->17
end
11--"0:0<br>[int(6)] -> [int(6)]"-->13
11--"1:1<br>int(6)"-->13
13--"0:0<br>int(6)"-->12
end
subgraph 20 ["(20) FuncDefn: #quot;main#quot;"]
direction LR
21["(21) Input"]
22["(22) Output"]
subgraph 23 ["(23) CFG"]
direction LR
subgraph 24 ["(24) DataflowBlock"]
direction LR
25["(25) Input"]
26["(26) Output"]
28["(28) LoadFunction"]
29["(29) const:custom:u64(1)"]
30["(30) LoadConstant"]
31["(31) Call"]
32["(32) Tag"]
28--"0:0<br>[int(6)] -> [int(6)]"-->31
29--"0:0<br>int(6)"-->30
30--"0:1<br>int(6)"-->31
32--"0:0<br>Unit"-->26
end
27["(27) ExitBlock"]
24-."0:0".->27
end
21-."0:0".->23
23-."0:0".->22
end
1--"0:0<br>[int(6)] -> [int(6)]"-->28
10--"0:2<br>[[int(6)] -> [int(6)], int(6)] -> [int(6)]"-->31
end