@ val Seq(a, b, c) = collection.mutable.Buffer(1, 2, 3) scala.MatchError: ArrayBuffer(1, 2, 3) (of class scala.collection.mutable.ArrayBuffer) ammonite.$sess.cmd0$.<clinit>(cmd0.sc:1)
Ideally I’d want the
Seq matcher to be able to handle mutable collections, but given that it can’t, does anyone know why it’s a runtime error and not a compile time error?
For example, the following fails at compile time:
@ val Seq(a, b, c) = 123 cmd1.sc:1: scrutinee is incompatible with pattern type; found : Seq[A] required: Int val Seq(a, b, c) = 123 ^ Compilation Failed