p4lang / p4-spec

Apache License 2.0
178 stars 80 forks source link

Specify valid type alias rule for string type #1294

Closed jaehyun1ee closed 3 months ago

jaehyun1ee commented 3 months ago

Proposing clarification for under-specified case, whether it is valid when string is aliased by either typedef or type. (#1293)

I expect that new type declaration (type) does not allow string type, and such is allowed for typedef. Checking with the p4c compiler, it currently allows string to be aliased by typedef, e.g.,typedef string string_t; typechecks.

jonathan-dilorenzo commented 3 months ago

Hi @jaehyun1ee! Thanks a lot for sending this PR. It turns out that there is another PR (https://github.com/p4lang/p4-spec/pull/1296) that coincidentally fixes this issue as well that we were planning to merge anyway, so I think we'll just merge that one.

@vlstill, this is a nice separation of concerns though, so you could just merge this and then have yours only deal with the other table? Up to you.

jaehyun1ee commented 3 months ago

Thank you! It would be fine to merge @vlstill's PR without merging this one since we were dealing with the same problem :)

vlstill commented 3 months ago

If we want to separate concerns, we should add the list case to this PR. I don't mind going either way.

jaehyun1ee commented 3 months ago

Closing in favor of #1296