Closed
Description
Compiler version
3.3.1
Minimized example
val f: (Int, Int) => Int = Integer.compare(_ + 1, _)
Output Error/Warning message
-- [E086] Syntax Error: --------------------------------------------------------
1 |val f: (Int, Int) => Int = Integer.compare(_ + 1, _)
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| Wrong number of parameters, expected: 2
1 error found
Why this Error/Warning was not helpful
The error message is correct, but I must work hard to realise that actually the first argument to Integer.compare
is expanded to a separate nested lambda, so the placeholder is not for f
.
Suggested improvement
The error could be improved by an explanation. Under -explain I would like to see:
- The full expected type
- The eta expanded argument
This would make it clear which parameter each placeholder refers to.