Closed
Description
reproduction steps
Scala version: 2.13.3
object Main
extends App {
class Unapplyer {
def unapplySeq(seq: Seq[Int]): Option[(Int, Seq[Int])] =
if (seq.isEmpty) None else Some((seq.head, seq.tail))
}
val unapplyer = new Unapplyer
/*
v2.12.12:
prints "1"
v2.13.3:
type mismatch;
found : Unit
required: Int
case value unapplyer () => println(value)
*/
Seq(1) match {
case value unapplyer () => println(value)
}
}
problem
The code above can't be compiled with Scala 2.13.