-
Notifications
You must be signed in to change notification settings - Fork 173
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
Fix future clause warnings introduced by upcoming sail release #689
base: master
Are you sure you want to change the base?
Conversation
I don't like this; it silences what would otherwise be actual legitimate incomplete match warnings. That is, now if a new extension is added you don't get a new warning, but previously you would. |
Open to other approaches, but we definitely need to do something otherwise we will introduce new warnings with the next Sail update. Maybe @Alasdair has a suggestion? |
My view is that the existence of this warning for this code is a bug in the Sail compiler and so should be fixed there. For non-scattered matches it perhaps makes sense, but this warning does not seem to me like a sensible thing to be doing for scattered matches. |
Note that rems-project/sail#825 uses a non-scattered match as the motivating example, and there are no tests that use a scattered match. I strongly believe this warning was not intended to occur here and this is an oversight in its implementation. |
Yeah, I just found the same thing and agree that it should probably not apply for scattered matches. Will open an issue against sail. |
I'm guessing this is a result of how scattered definitions are handled. Internally the individual clauses are collected and turned into a single non-scattered definition at the site of the final clause, not where the (I forget if it's legal to not include an end, but if so then probably scattered matches without an end should not warn, since they're still open) |
Yeah I noticed this too. An extra problem is that when we use the new project file you'll theoretically be able to exclude entire extensions from compilation (I think this helps the SV/formal backends), but since I put all of the Also maybe I'm blind but how does this PR fix the warning for |
That's a good point. I hadn't considered the interaction with the module system. It seems like maybe the wildcard match is the way to go then. It means we won't get warnings if someone forgets to implement an
For |
But if they forget to implement extensionEnabled they should get a warning! |
Yeah definitely, but I can't see a way to achieve that given all the constraints. |
The in-development next version of Sail introduces new warnings to catch incomplete pattern matching from potential future clauses. This refactors
riscv_insts_end.sail
to avoid this by adding a new wildcard match for undefined extensions and reordering theend
clauses.