Open rw1nkler opened 5 months ago
Updated syntax:
struct MyData<WIDTH : u32>{value : uN[WIDTH]}
proc MyProc<DATA_WIDTH: u32> {
type Data = MyData<DATA_WIDTH>;
out_s: chan<Data> out;
config(out_s: chan<Data> out) {(out_s, )}
init {}
next(_: ()) {
// option I: Redefining MyData type and using it works correctly
//type Data = MyData<DATA_WIDTH>;
//let tok = send(join(), out_s, Data { value: uN[DATA_WIDTH]:0 });
// option II: Using proc-scoped type alias fails
send(join(), out_s, Data{value : uN[DATA_WIDTH] : 0});
}
}
const TEST_WIDTH = u32:32;
#[test_proc]
proc MyProcTest {
type Data = MyData<TEST_WIDTH>;
terminator: chan<bool> out;
out_r: chan<Data> in;
config(terminator: chan<bool> out) {
let(out_s, out_r) = chan<Data>("out");
spawn MyProc<TEST_WIDTH>(out_s);
(terminator, out_r)
}
init {}
next(_: ()) {
let(tok, _) = recv(join(), out_r);
send(tok, terminator, true);
}
}
Describe the bug
Using proc-scoped type aliases to instantiate parametric structs leads to type deduction errors when the struct's parameter is taken from a proc parameter.
To Reproduce
One can identify the issue when running tests with the DSLX interpreter for this code:
Here is the error message from executing the test:
Source file: myproc.x
Expected behavior The type deduction for the proc-scoped alias should work correctly because it works for the same alias declared in
next
functionAdditional context Related issues:
FYI @cdleary