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
The below program default-control-argument.p4 from the p4c test suite expects that control declaration MyC matches the control type signature C<H, M>. (The compiler frontend treats this program as valid.)
However, I wonder if the above program should actually be accepted as valid, as per the spec. Default parameters can be omitted when invoking the control instance, but I believe they cannot be omitted when declaring a control object.
The above code is also misleading because,
The control type declaration control<H, M> implies that we can explicitly supply an argument corresponding to the intr_md parameter.
However, if we were to supply a third argument for MyC, it would result in an error since the control declaration MyC expects only two.
P4 allows default control parameters.
The below program
default-control-argument.p4
from the p4c test suite expects that control declarationMyC
matches the control type signatureC<H, M>
. (The compiler frontend treats this program as valid.)However, I wonder if the above program should actually be accepted as valid, as per the spec. Default parameters can be omitted when invoking the control instance, but I believe they cannot be omitted when declaring a control object.
The above code is also misleading because,
control<H, M>
implies that we can explicitly supply an argument corresponding to theintr_md
parameter.MyC
, it would result in an error since the control declarationMyC
expects only two.A valid program would write something like:
The text was updated successfully, but these errors were encountered: