You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#825 introduced a warning for unmatched future clauses in scattered enums. This makes sense when the entire match is written in one place, but probably shouldn't apply for scattered matches. See riscv/sail-riscv#689.
The text was updated successfully, but these errors were encountered:
I did consider this situation, and there is an interaction between scattered definitions and the Sail module system that makes this warning still valid, which is that you can have an optional module A define the function clause and an optional module B define the enumeration/union clause it matches on. In this case the <future E clause> part of the warning is a bit misleading because it would really be something more like <E clause from non-required module>.
When you have a modular specification with optional modules, what the type system (and by extension the pattern-completeness checker) are checking is really that any combination of modules work, sort of like parametricity for polymorphic functions - but you also want to be able to check modules separately using just their local definitions and their requirement/imports, so the checker just considers scattered definitions as being 'open' which essentially forces wildcard cases in some places where if you took a global view of all the modules you might be able to reason that a match is actually complete.
Of course it is just a warning, so we could decide in this case to not issue a warning.
Hmm. The interaction with the module system is an interesting case that I hadn't considered. It is still unfortunate that we need to add a wildcard match to avoid a warning in cases like this, but maybe it is unavoidable.
#825 introduced a warning for unmatched future clauses in scattered enums. This makes sense when the entire match is written in one place, but probably shouldn't apply for scattered matches. See riscv/sail-riscv#689.
The text was updated successfully, but these errors were encountered: