-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are match_kinds compile-time known? #998
Comments
I think that the first question to ask is whether match kinds are real types :) I was just thinking where we can use them in practice and so far the only thing that came to mind was to use them as parameters in a control, e.g.:
The compiler stopped at the line
|
Indeed, there sees to be no way to name the |
Should we just treat |
These types are very much like enums. |
I am not sure, but perhaps this PR is related? #1020 Issue I filed recently with a different test program I was trying to make compile with at least p4test, but failed: p4lang/p4c#3091 PR on p4c that is recently merged in (less than an hour ago as I write this comment) that Mihai wrote to fix that issue: p4lang/p4c#3099 @vgurevich You might want to try compiling your test program above with the latest main version of p4c and see if the error message has changed, or maybe there might even not be any error message now? |
I hope that we have now answered this question in the affirmative. Can we close this issue? |
This code fails to type check:
because
match_kind
s are not compile-time known values. However, this code does type check:It is a silly example, but is this what we want?
The text was updated successfully, but these errors were encountered: