Skip to content

Conversation

xuwei-k
Copy link
Member

@xuwei-k xuwei-k commented Sep 12, 2025

Don't use ::.unapply method for Seq

Welcome to Scala 2.12.20 (OpenJDK 64-Bit Server VM, Java 21.0.8).
Type in expressions for evaluation. Or try :help.

scala> def seq1: Seq[Int] = List(2)
seq1: Seq[Int]

scala> seq1 match {
     |   case x :: Nil => "single"
     |   case _ => "other"
     | }
res0: String = single

scala> def seq2: Seq[Int] = Vector(2)
seq2: Seq[Int]

scala> seq2 match {
     |   case x :: Nil => "single"
     |   case _ => "other"
     | }
res1: String = other

@eed3si9n eed3si9n merged commit 66e2758 into sbt:main Sep 12, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants