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

error during expansion of this match expression (this is a scalac bug) #8508

Closed
scabug opened this issue Apr 16, 2014 · 3 comments
Closed

error during expansion of this match expression (this is a scalac bug) #8508

scabug opened this issue Apr 16, 2014 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Apr 16, 2014

The following code does not compile with the error message: "error during expansion of this match expression (this is a scalac bug)"

object Test {

  sealed abstract class ObjectValue {

    type ExternalRep
    def externalRep: ExternalRep

    override def equals(other: Any): Boolean = other match {
      case ObjectValue(otherExRep) => otherExRep == externalRep
      case _ => false
    }

  }

  object ObjectValue {
    def apply[ExRep](underlying: ExRep): ObjectValue = new ObjectValue {
      type ExternalRep = ExRep
      val externalRep = underlying
    }
    def unapply(ov: ObjectValue): Option[(ov.ExternalRep)] = Some(ov.externalRep)
  }
}
@scabug
Copy link
Author

scabug commented Apr 16, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8508?orig=1
Reporter: stefan.wachter-at-gmx.de
Affected Versions: 2.10.4, 2.11.0-RC4
Duplicates #6130

@scabug
Copy link
Author

scabug commented Apr 16, 2014

@retronym said:
Whittled down a little:

object Test {
  (null: Any) match {
    case Extractor(otherExRep) => 
      println(otherExRep)
  }

  trait T {
    type U 
  }

  object Extractor {
    def unapply(t: T): Option[t.U] = ???
  }
}

@scabug
Copy link
Author

scabug commented Apr 16, 2014

@retronym said:
I'm going to merge this report with #6130.

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

No branches or pull requests

2 participants