Open jcarbaut opened 4 days ago
scala-cli compile --script-snippet '(new Function[(Int, Int), Int] {def apply(a: Int, b: Int): Int = a * b})(2, 3)'
Here's the output when compiled outside of the REPL:
Labelling as a regression, as it seems this used to not crash pre-3.3.1.
Last good stable version: 3.3.0 First bad stable version: 3.3.1
Compiler version
3.5.2
Minimized code
When running in scala-cli, the following crashes:
Of course, the above code is invalid, there should be a single tuple argument to
apply
. The unexpected result is that Scala crashes altogether instead of just throwing an exception.It should be replaced with any of the following, which both work:
Output (click arrow to expand)
Note