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
packagecrasher {
classZ[@specialized A, @specialized(AnyRef) B](vara:A, varb:B) { }
objectO {
defapply[@specialized A, @specialized(AnyRef) B](a0: A, b0: B) =newZ(a0,b0)
}
}
For the crash to occur, you need at least two specialized types, at least one has to be AnyRef, and there have to be at least two specialized types for at least one of the entries.
The compiler complains:
error: scala.tools.nsc.symtab.Types$TypeError:typemismatch;
found : B$sp(in method apply$mVTc$sp)
required: B$sp(in classZ$mcVT$sp)
at scala.tools.nsc.typechecker.Contexts$Context.error(Contexts.scala:291)
at scala.tools.nsc.typechecker.Infer$Inferencer.error(Infer.scala:205)
at scala.tools.nsc.typechecker.Infer$Inferencer.typeError(Infer.scala:215)
at scala.tools.nsc.typechecker.Infer$Inferencer.typeErrorTree(Infer.scala:230)
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:929)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4219)
...
The text was updated successfully, but these errors were encountered:
@paulp said:
Reopening, I didn't really fix this, it just stopped happening when I broke something else, and unbreaking that put this back the way it was.
This crashes the compiler.
For the crash to occur, you need at least two specialized types, at least one has to be AnyRef, and there have to be at least two specialized types for at least one of the entries.
The compiler complains:
The text was updated successfully, but these errors were encountered: