Enable const
identifiers in bit slice expressions, and anywhere else local compile-time known values are allowed
#4920
Labels
p4-spec
Topics related to the P4 specification (https://github.com/p4lang/p4-spec/).
Here is an example test program that exhibits this issue:
This change was made to the language spec recently: p4lang/p4-spec#1307
Thus according to the spec, the following code is legal:
In some test programs I have tried this works fine, but in others it gives an error. I have not tried to get to the root cause of the difference between such programs.
Note: Technically the language spec enhancement also allows
const
values to be used in any place where a local compile-time known value is required, but a bit slice hi or lo expression are the only ones I know of off the top of my head.The text was updated successfully, but these errors were encountered: