pattern match returns a different result for ArrayBuffer and Seq
问题 In the sample below, there is a function seqResult that pattern matches against a Seq . Another function that accepts variable arguments calls seqResult and passes in an ArrayBuffer . This causes the pattern match result to be different when called with a Seq or with an ArrayBuffer . With a Seq the matcher hits case head :: rest => ... , with an ArrayBuffer the matcher hits case Seq(one, two) => ... . Is this a bug? Is there anyway to safeguard against this? If it's not a bug, what is a safe