On Thu, Oct 22, 2020 at 10:42 AM MRAB email@example.com wrote:
- SyntaxError if an irrefutable case is followed by another case
- SyntaxError if an irrefutable pattern occurs on the left of '|',
e.g. 'x | [x]'.
Is "syntax error" that the right term for it? Maybe it should be something different, a subclass of SyntaxError perhaps.
I think it is a SyntaxError. It is detected without needing to look at the symbol table, although it is not encoded in the grammar (we probably could, but it would be very tedious), so it's done during a later stage. We have many of these (e.g. 'return' outside function, also not encoded in the grammar).