3 ms·
Ah yes I forgot to write the "in var/let" part which was supposed to be there. That is you can only use refutable patterns in `switch` (and `if let`/`while let
by masklinn 11y ago
Ah yes I forgot to write the "in var/let" part which was supposed to be there.
That is you can only use refutable patterns in `switch` (and `if let`/`while let` though I believe those are still restricted to Option, not general-purpose as in Rust, that correct?). In Erlang you can use a refutable match in an "assignment", that's basically a pattern assertion, a more general-purpose version of Swift's forced unwrapping.