Closed
Description
Compiler version
Scala 3.0.2 (Scastie)
Minimized code
type ~>[Args <: Tuple, Return] = Args match {
case (arg1, arg2) => ((arg1, arg2) => Return)
}
trait Builder[Args <: NonEmptyTuple] {
def apply(f: Args ~> String): String
}
class BuilderImpl[Args <: NonEmptyTuple] extends Builder[Args] {
override def apply(f: Args ~> String): String = ???
}
val builder = BuilderImpl[Int *: String *: EmptyTuple]()
// builder { (i: Int, s: String) => "test" } // This line compiles
builder { (i, s) => "test" } // Does not compile
Output
Missing parameter type I could not infer the type of the parameter i.
Missing parameter type I could not infer the type of the parameter s.
Expectation
No compiler error; I would expect the compiler to be able to infer the type of the function's arguments without annotations.