Skip to content

[A] => ((x: A) => x) is not handled correctly #6725

Closed
@smarter

Description

@smarter

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

No one assigned

    Labels

    area:desugarDesugaring happens after parsing but before typing, see desugar.scalaitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions