You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
DSLX parser stumbles on type aliases in parametric instantiations. It seems to parse the expression as multiple comparison operators after reaching the > after the parametric value when the type is not a builtin type.
To Reproduce
Steps to reproduce the behavior:
Compile below snippet:
type foo_t = bits[32];
fn f<N:u32>(x: u32) -> u32 { N + x }
fn main(x: u32) -> u32{ f<foo_t:1>(x) }
Get error:
0002:
0003: fn f<N:u32>(x: u32) -> u32 { N + x }
0004: fn main(x: u32) { f<foo_t:1>(x) }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ParseError: comparison operators cannot be chained
0005:
Change foo_t:1 to bits[32]:1.
Compile succeeds.
Change foo_t:1 to u32:1.
Compile succeeds.
Expected behavior
should be equivalent to 3. and 5.
The text was updated successfully, but these errors were encountered:
proppy
added
bug
Something isn't working or is incorrect
dslx
DSLX (domain specific language) implementation / front-end
labels
Jun 18, 2024
Describe the bug
DSLX parser stumbles on type aliases in parametric instantiations. It seems to parse the expression as multiple comparison operators after reaching the
>
after the parametric value when the type is not a builtin type.To Reproduce
Steps to reproduce the behavior:
foo_t:1
tobits[32]:1
.foo_t:1
tou32:1
.Expected behavior
The text was updated successfully, but these errors were encountered: