-
Notifications
You must be signed in to change notification settings - Fork 446
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
extern with different type parameter but the same name? #1585
Comments
I guess a related question would be is it possible to specify a default type parameter? |
Something along this line would be ideal
|
the language as it is now does not allow for overloading of types, or for default type arguments. |
A default type argument would be a very helpful feature for one of our use cases. It can be used to describe an extern that normally returns a system-defined SerEnum type, and can be customized to return a user-defined SerEnum type. As shown in the above example. It helps to evolve architecture without breaking backward compatibility. |
You should bring it to the language design working group. For the user there will be no visible change, but the back-end will have to change to handle both these types. |
Sure. I can bring this up in the language design group. Do you have cycle to prototype the feature? |
I never have enough cycles; the question is what is most important to implement. There are still too many bugs to fix, I tend to prioritize these. If this is very important we can push it up. |
It would be great if you could give it a higher priority. Thank you! |
I will start as soon as you remove the ugly macros from the bmv2 back-end. |
A write-up on the issue in case we need to discuss the issue today in the language design meeting. |
An example PSA program in p4lang/p4c today. |
As shown below, is it possible to support externs with different type parameter, but the same name?
meter-extern.p4.txt
Currently frontend returns the following error message.
The text was updated successfully, but these errors were encountered: