E1048: pattern does not fit the subject
Every pattern of a case must fit the subject.
Every pattern of a case must fit the subject. A variant pattern must name a
variant of the subject's own enum, and its payload must have the shape that
the variant declares. A literal pattern must have the subject's type, so a
Bool literal does not match an Int, an integer literal does not match a
Bool, and an integer literal must fit the subject's integer type. The message names the expected and the found type.
For a payload that has the wrong shape, it shows the pattern the variant
declares and the pattern that was written, such as Shape.Circle(_) and
Shape.Circle. The error points at the pattern.
Example
Fix
Match with patterns of the subject's own type, and with literals that fit it.
Run actus explain E1048 in your terminal to read this entry offline. Browse Ownership & types or all error codes.