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

Comments

Projects
None yet
1 participant
@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

This comment has been minimized.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment