Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid type error in nested pattern match with existentials #9570

Open
scabug opened this issue Nov 26, 2015 · 1 comment
Open

Invalid type error in nested pattern match with existentials #9570

scabug opened this issue Nov 26, 2015 · 1 comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) typer
Milestone

Comments

@scabug
Copy link

scabug commented Nov 26, 2015

class Base[T] {
  def set(t: T): Unit = ()
}
class Inter[T] extends Base[T]
class Concrete extends Inter[List[String]]

object Fail {
  val r: Base[_] = new Concrete
  r match {
    case i: Inter[_] =>
      i match {
        case c: Concrete =>
          c.set(Nil)
      }
  }
}

Result:

Error:(16, 17) type mismatch;
 found   : scala.collection.immutable.Nil.type
 required: _1
          c.set(Nil)
                ^
@scabug
Copy link
Author

scabug commented Nov 26, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9570?orig=1
Reporter: @ghik
Affected Versions: 2.11.7

@scabug scabug added the typer label Apr 7, 2017
@SethTisue SethTisue added this to the Backlog milestone Jul 25, 2023
@SethTisue SethTisue added the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) typer
Projects
None yet
Development

No branches or pull requests

2 participants