You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
has the compiler crash with the following stack trace.
Exception in thread "main" java.lang.AssertionError: assertion failed: T(_) ==>Test.this.T.unapply[Nothing](<unapply-selector>) <unapply> (_), pt =Test.T[?] forSome { typeV<:W }
at scala.Predef$$.assert(Predef.scala:92)
at scala.tools.nsc.typechecker.Typers$$Typer.doTypedApply(Typers.scala:1837)
at scala.tools.nsc.typechecker.Typers$$Typer.doTypedApply(Typers.scala:1756)
at scala.tools.nsc.typechecker.Typers$$Typer.typedApply$$1(Typers.scala:2553)
at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3140)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3243)
at scala.tools.nsc.typechecker.Typers$$Typer.typedArg(Typers.scala:1591)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$typedArgs$$2.apply(Typers.scala:1607)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$typedArgs$$2.apply(Typers.scala:1607)
...
The crash is not reproducible when case classes are used.
I have no idea as to whether this program should be rejected, or if a sensible type can be given to it.
The text was updated successfully, but these errors were encountered:
Mikhail Vorozhtsov (mikhail.vorozhtsov) said:
I have a simpler (certainly not "wild") example which produces the same stack trace as the original snippet on 2.8.1 and 2.9.0.r24458-b20110315020117:
finalcaseclassW[A](v: A)
objectE {
defunapply(w: W[Any]):Option[Any] =None
}
objectBug {
defbug[A](e: Either[W[_], A]) = e match {
caseLeft(E(x)) =>case _ =>
}
}
Commit Message Bot (anonymous) said:
(extempore in r25277) Bounded wildcard types arising during pattern type inference can
cause unnecessary crashes. Closes #1048, review by odersky.
Compiling the following code,
has the compiler crash with the following stack trace.
The crash is not reproducible when case classes are used.
I have no idea as to whether this program should be rejected, or if a sensible type can be given to it.
The text was updated successfully, but these errors were encountered: