Skip to content

Polymorphic function value not allowed depending on placement of braces #12323

Closed
@jrudolph

Description

@jrudolph

Seems to be a variation of #6725:

type X[T] = [U] => U => U

// These work:
val x1: X[Int] = [U] => (u: U) => u
val x2: X[Int] = [U] => ((u: U) => u)
val x3: X[Int] = [U] => (u: U) => { u }

// This one complains with "Implementation restriction: polymorphic function literals must have a value parameter"
val xe: X[Int] = [U] => { (u: U) => u }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions