Skip to content

Very slow compilation with SAM types with multiple parameter lists #490

@smarter

Description

@smarter

Foo here should probably not be treated as a SAM type if we want to be sane:

trait Foo {
  def app(x: Object)(y: Object): Object
}

object O {
  def main(args: Array[String]): Unit = {
    val z: Foo = x => ???
  }
}

Currently it takes a long time to produce an error message, it seems to spend most of its time in implicit search before giving up:

[error] try/closmulti.scala:7: error: type mismatch:
[error]  found   : Nothing
[error]  required: (y: Object)Object
[error]     val z: Foo = x => ???
[error]                       ^
[error] one error found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions