Closed joshhornby closed 6 years ago
It's redundant because pattern matching does not work like in Erlang or Elixir.
In the next release of the compiler, this will be caught because the compiler disallows variable name shadowing. I think that will also be helpful for folks coming from Erlang and Elixir who are expecting pattern matches to work different.
I recommend asking around on the slack channel for further clarification in the meantime. And thanks for the report!
If you try and use a function inside a case statement the results are potentially unexpected
Will throw:
This is because you can't call a function as you need to use a 'pattern'.
Maybe the error message can check if a function is being used, and if so warn the user about what they are doing as well as telling them the pattern is redundant?
Example Ellie: https://ellie-app.com/jBM3qQDFMa1/0