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
Section 8.13: Two structs can be compared for equality (==) or inequality (!=) only if they have the same type and all of their fields can be recursively compared for equality. Two structures are equal if and only if all their corresponding fields are equal.
That's defining the equality of two struct values, not two struct types. The spec uses type equality often, often phrased something like "x and y must have the same type," but I don't think it ever defines it.
I created this issue on the P4_16 language spec in an attempt to cause a future version to explicitly address the issue of what "same type" means, at least for headers and structs: p4lang/p4-spec#875
examples/checker_tests/bad/issue2230-1-bmv2.p4
This test is enforcing nominal equality for structs, which is not how we do type equality.
The text was updated successfully, but these errors were encountered: