Open
Description
Compiler version
3.1.0 2654b56
Minimized code
def f(f: [U] => Int ?=> PartialFunction[U, Unit]): Unit = f[Int](using 1)(2)
def test =
f([X] => (x: Int) ?=> {
case 3 =>
})
f {
case 3 =>
}
Output
-- [E081] Type Error: Bar.scala:6:4 --------------------------------------------
6 | case 3 =>
| ^
| Missing parameter type
|
| I could not infer the type of the parameter x$1 of expanded function:
| x$1 =>
| x$1 match
| {
| case 3 =>
| <empty>
| }.
-- [E007] Type Mismatch Error: Bar.scala:7:3 -----------------------------------
7 | })
| ^
| Found: [X] => (Int) ?=>
| <error Missing parameter type
|
| I could not infer the type of the parameter x$1 of expanded function:
| x$1 =>
| x$1 match
| {
| case 3 =>
| <empty>
| }.>
| => Unit
| Required: [U] => (Int) ?=> PartialFunction[U, Unit]
longer explanation available when compiling with `-explain`
-- [E081] Type Error: Bar.scala:10:4 -------------------------------------------
10 | case 3 =>
| ^
| Missing parameter type
|
| I could not infer the type of the parameter x$1 of expanded function:
| x$1 =>
| x$1 match
| {
| case 3 =>
| <empty>
| }.
3 errors found
Expectation
These should compile. Starting with the non-eta-expanded version that would.