E4009

E4009#

Match function expects a different number of arguments than provided.

Erroneous Example#

let f = fn {
  0 => 0
  a, b => a + b
}

The example defines a match function that has incoherent number of arguments in different branches. This will result in the following error on line 3:

Match function expects 1 arguments, but 2 arguments are provided.

Suggestion#

Change the branches so that the number of arguments are exactly the same in all of them:

let f = fn {
  0 => 0
  a => a
}