xls
xls copied to clipboard
Type aliases cannot be used in parametric instantiations
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:1tobits[32]:1. - Compile succeeds.
- Change
foo_t:1tou32:1. - Compile succeeds.
Expected behavior
- should be equivalent to 3. and 5.