Error code E0005
Patterns used to bind names must be irrefutable, that is, they must guarantee that a name will be extracted in all cases.
Erroneous code example:
ⓘ
If you encounter this error you probably need to use a match
or if let
to
deal with the possibility of failure. Example: