Skip to content

Failure to lift a FunctionN to Function1[TupleN[...], ...] #12127

Closed
@mpilquist

Description

@mpilquist

Compiler version

3.0.0-RC2

Minimized code

scala> Option((1, 2, 3)).map(_ + _ + _)
val res0: Option[Int] = Some(6)

scala> def foo[T <: Tuple : Tuple.IsMappedBy[Option]](t: T)(f: Tuple.InverseMap[T, Option] => Int) = null
def foo
  [T <: Tuple]
    (t: T)
      (f: Tuple.InverseMap[T, Option] => Int)
        (implicit evidence$1: Tuple.IsMappedBy[Option][T]): Null

scala> foo(Option(1), Option(2), Option(3))(_ + _ + _)
1 |foo(Option(1), Option(2), Option(3))(_ + _ + _)
  |                                     ^^^^^^^^^
  |                                   Wrong number of parameters, expected: 1

Expectation

_ + _ + _ should be automatically lifted from Function3[Int, Int, Int, Int] to Function1[Tuple3[Int, Int, Int], Int]

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