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

MatchError with existential types #40

Closed
scabug opened this issue Aug 31, 2007 · 2 comments
Closed

MatchError with existential types #40

scabug opened this issue Aug 31, 2007 · 2 comments
Assignees

Comments

@scabug
Copy link

scabug commented Aug 31, 2007

Aladdin: [http://scala-webapps.epfl.ch/bugtracking/contribs/display.do?id=744 contrib 744]

== Code ==

object test extends Application {
  type U = (T, Option[T]) forSome { type T }
  val p: U = ("foo", Some("bar"))
  p match {
    case pp: U => println(""+pp._1+" "+pp._2)
  }
}

== What happened ==

Exception in thread "main" scala.MatchError: ((T, Option[T]) forSome { type T },(?T, Option[?T]))
        at scala.tools.nsc.symtab.Types$$class.isConsistent$$0(Types.scala:2734)
        at scala.tools.nsc.symtab.Types$$$$anonfun$$63.apply(Types.scala:2747)
        at scala.tools.nsc.symtab.Types$$$$anonfun$$63.apply(Types.scala:2746)
        at scala.List.forall(List.scala:896)
        at scala.tools.nsc.symtab.Types$$class.isPopulated(Types.scala:2746)
        at scala.tools.nsc.symtab.SymbolTable.isPopulated(SymbolTable.scala:11)
        at scala.tools.nsc.typechecker.Infer$$Inferencer.inferTypedPattern(Infer.scala:980)
        at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2802)
        at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:2950)
        at scala.tools.nsc.typechecker.Typers$$Typer.typedBind$$0(Typers.scala:2023)
        at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2720)
        at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:2950)
        at scala.tools.nsc.typechecker.Typers$$Typer.typedPattern(Typers.scala:3011)
        at scala.tools.nsc.typechecker.Typers$$Typer.typedCase(Typers.scala:1329)
        at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$48.apply(Typers.scala:1361)
        at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$48.apply(Typers.scala:1360)
        at scala.List$$.loop$$0(List.scala:244)
        at scala.List$$.mapConserve(List.scala:261)
        at scala.tools.nsc.typechecker.Typers$$Typer.typedCases(Typers.scala:1360)
        ...

== What expected ==

no crash

More code examples available in [http://scala-webapps.epfl.ch/bugtracking/contribs/display.do?id=744 contrib 744]

@scabug
Copy link
Author

scabug commented Aug 31, 2007

Imported From: https://issues.scala-lang.org/browse/SI-40?orig=1
Reporter: @milessabin

@scabug
Copy link
Author

scabug commented Jan 14, 2009

@odersky said:
Milestone 2.6.0 deleted

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

No branches or pull requests

2 participants