p4-spec icon indicating copy to clipboard operation
p4-spec copied to clipboard

Legal to form header stacks of header unions?

Open hackedy opened this issue 5 years ago • 3 comments

I'm having trouble telling if header stacks H[n] require H to be a header only or if they also allow header unions. The p4c typechecker allows unions, and the original proposal #139 said unions were ok. Maybe this should be an additional column in the type nesting table?

hackedy avatar Jun 24 '20 03:06 hackedy

I have thought that the intent was that header stacks where the elements are header unions were intended to be supported in the spec, but at least right now do not see anything explicitly saying so in the spec. It does seem worth mentioning it explicitly.

jafingerhut avatar Jun 24 '20 07:06 jafingerhut

I actually found the same issue plus the p4c is getting many new testcases for header stacks with header unions so this gets more important to fix the specifications if we want to allow it.

apinski-cavium avatar May 22 '22 05:05 apinski-cavium

There is a testcase in the p4c already for header stacks of header unions. ./p4_16_samples_outputs/spec-ex09.p4 and p4_16_samples/spec-ex19.p4 which were added with https://github.com/p4lang/p4c/commit/bb47b71882 (well it was moved to the p4_16 directory later on).

apinski-cavium avatar Oct 21 '22 00:10 apinski-cavium

Closing as this seems to have been fixed.

jnfoster avatar Nov 11 '23 13:11 jnfoster