Open
Description
Compiler version
3.2.2
Minimized code
object BugReport:
trait Executor
trait Updatable[+A]
def run(task: Executor ?=> Unit): Unit = {}
def tupledFunction(a: Int, b: Int): Unit = {}
def tupledSequence(f: ((Updatable[Int], Updatable[Int])) => Unit): Unit = {}
type UpdatableMap[T <: Tuple] = T match
case EmptyTuple => EmptyTuple
case h *: t => Updatable[h] *: UpdatableMap[t]
def liftAsTupledInThreads[A <: Tuple](f: A => Unit)(using e: Executor): UpdatableMap[A] => Unit = ???
run {
tupledSequence(liftAsTupledInThreads(tupledFunction.tupled))
}
run {
val lifted = liftAsTupledInThreads(tupledFunction.tupled)
tupledSequence(lifted)
}
Output
BugReport.scala:16:20
Found: (e : (BugReport.Updatable[Int],
BugReport.Updatable[Int]
))
Required: BugReport.Executor
tupledSequence(liftAsTupledInThreads(tupledFunction.tupled))
Expectation
Two "run" sections are essentially the same, but the second compiles as expected, and the first fails.
The error message suggests that it swaps the argument of the returned function and the context bound.