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
I have run into this again and it's going to be a problem for improving the pattern matcher's type parameter handling. I don't think it actually has anything to do with tailcalls (although it may), I think that's only where it's being revealed, and it originates in the typer. So I'm reassigning to scala_reviewer to see if it can get another look.
Here is a distillation of the problem.
abstractclassBar[+B] {
}
abstractclassC1[+B] extendsBar[B] {
private[this] defg(x: C1[B]):Unit= ()
// this method is fine: notice that it allows the call to g,// which requires C1[B], even though we matched on C1[_].// (That is good news.)private[this] deff1(x: Bar[B]):Unit= x match {
casex: C1[_] => g(x)
}
// this one crashes.private[this] deff2(x: Bar[B]):Unit= x match {
casex: C1[_] => f2(x)
}
}
The crash:
Exception in thread "main" scala.tools.nsc.symtab.Types$$TypeError:typemismatch;
found : C1[_]
required: Bar[B]
at scala.tools.nsc.typechecker.Contexts$$Context.error(Contexts.scala:280)
at scala.tools.nsc.typechecker.Infer$$Inferencer.error(Infer.scala:203)
at scala.tools.nsc.typechecker.Infer$$Inferencer.typeError(Infer.scala:213)
at scala.tools.nsc.typechecker.Infer$$Inferencer.typeErrorTree(Infer.scala:228)
at scala.tools.nsc.typechecker.Typers$$Typer.adapt(Typers.scala:1018)
at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:4186)
at scala.tools.nsc.typechecker.Typers$$Typer.typedArg(Typers.scala:2209)
at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$typedArgs$$3.apply(Typers.scala:2220)
The text was updated successfully, but these errors were encountered:
[Deleted original report]
I have run into this again and it's going to be a problem for improving the pattern matcher's type parameter handling. I don't think it actually has anything to do with tailcalls (although it may), I think that's only where it's being revealed, and it originates in the typer. So I'm reassigning to scala_reviewer to see if it can get another look.
Here is a distillation of the problem.
The crash:
The text was updated successfully, but these errors were encountered: