-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:desugarDesugaring happens after parsing but before typing, see desugar.scalaDesugaring happens after parsing but before typing, see desugar.scalaitype:bug
Description
It should be equivalent to [A] => (x: A) => x
but instead we get an error:
scala> val id: [A] => A => A = [A] => (x: A) => x
val id: PolyFunction{apply: [A](x$1: A): A} = <function1>
scala> val id: [A] => A => A = [A] => ((x: A) => x)
1 |val id: [A] => A => A = [A] => ((x: A) => x)
| ^
|Implementation restriction: polymorphic function literals must have a value parameter
Metadata
Metadata
Assignees
Labels
area:desugarDesugaring happens after parsing but before typing, see desugar.scalaDesugaring happens after parsing but before typing, see desugar.scalaitype:bug