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
enum bit<4> e
{
a = 1
}
control c(in bit<4> v)
{
apply{
switch(v) {
e.a:
default: {}
}
}
}
I would had assumed there was an implict conversion from the serializable enum to the underlying type here (as so many other places do the implict conversion) but p4c rejects this code with the following error message:
testsuite/p4c.language/valid/control/bitswitch-4.p4(8): [--Werror=type-error] error: SwitchStatement: not defined on bit<4> and e
switch(v) {
^^^^^^
Which is not helpful as it does not show the case label on where the problem is located.
The text was updated successfully, but these errors were encountered:
Take:
I would had assumed there was an implict conversion from the serializable enum to the underlying type here (as so many other places do the implict conversion) but p4c rejects this code with the following error message:
Which is not helpful as it does not show the case label on where the problem is located.
The text was updated successfully, but these errors were encountered: