Skip to content

Confusing error message when using Set in pattern match #8982

@scabug

Description

@scabug
// Test.scala
class Test {
  def doStuff(): Unit = {
    val (Seq(value), Set.empty[String]) = computeStuff(17)
  }

  def computeStuff(n: Int): (Seq[Int], Set[String]) =
    (Seq(n * 2), Set.empty[String])
}
Test.scala:3: error: type empty is not a member of object scala.collection.immutable.Set
    val (Seq(value), Set.empty[String]) = computeStuff(17)
                         ^
one error found

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions