Previously, match and cases expressions needed to have at least one pattern to match on. This allows them to work with zero patterns, which is useful for matching on empty types.
Since EmptyMatch is no longer a failure case, errors that previously said “I expected some patterns after a match / with or cases but I didn't find any,” now say “Pattern match doesn't cover all possible cases”.
Fixes #4731.
Test coverage
There is a new transcript that covers the new cases. The existing error-messages transcript captures the change in error message with empty cases that are applied to non-empty types.
Overview
Previously,
match
andcases
expressions needed to have at least one pattern to match on. This allows them to work with zero patterns, which is useful for matching on empty types.Since
EmptyMatch
is no longer a failure case, errors that previously said “I expected some patterns after a match / with or cases but I didn't find any,” now say “Pattern match doesn't cover all possible cases”.Fixes #4731.
Test coverage
There is a new transcript that covers the new cases. The existing error-messages transcript captures the change in error message with empty
cases
that are applied to non-empty types.