Closed pataei closed 1 year ago
For the three cases in this code.
Enum { name; typ = Some t; members }, Enum {typ = Some t'; _}
and
t', Enum { name; typ = Some t; members }
should only be allowed when explicit
is true
.
Quick fix: fix enum -> enum and t -> enum in Petr4 implementation. @pataei
Petr4 does the following while deciding if it can cast between two enums or between an enum and its underlying type:
This allows the implicit casting of two enums and the implicit casting of an underlying type to an enum. However, P4 considers both of these illegal.