p4lang / p4-hlir

Apache License 2.0
32 stars 40 forks source link

The conditional expression of ternary operator does not support action_params #13

Closed shouxi closed 8 years ago

shouxi commented 8 years ago

Hi, p4c compiler would yield ERROR: Undeclared identifier xxx, provided the ternary operator uses an action_param (e.g., xxx) in its conditional expression. This seems to be a bug (although easy to avoid by assigning the runtime value to a metadata field and using it for cond expressions instead).

antoninbas commented 8 years ago

Hi Shouxi,

It would be useful if you could provide a small P4 program to help us reproduce this issue.

Thanks

shouxi commented 8 years ago

Hi Antonin, See test.p4.txt, modified from P4 v1.1 Simple Router.