Closed
Description
Compiler version
3.1.3
Minimized code
enum PingMessage[Response]:
case Ping(from: String) extends PingMessage[String]
val pongBehavior: [O] => (Unit, PingMessage[O]) => (Unit, O) = [O] =>
(state: Unit, msg: PingMessage[O]) =>
msg match
case PingMessage.Ping(from) => ((), s"Pong from $from")
Scastie: https://scastie.scala-lang.org/omCKwdwSQ2uGyiYSPRbOLQ
Output
Found: [O] => (Unit, PingMessage[O]) => (Unit, String)
Required: [O] => (Unit, PingMessage[O²]) => (Unit, O²)
where: O is a type variable
O² is a type variable
Expectation
Compiles successfully