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
Pattern Matcher substitution doesn't handle references in singleton types #7459
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7459?orig=1 |
@retronym said: class LM {
class Node[B1]
// crash
val f: (LM => Any) = {
case t => new t.Node[Any]()
}
// okay
val g: (LM => Any) = {
t => new t.Node[Any]()
}
}
|
@paulp said: |
@paulp said: |
@retronym said (edited on May 6, 2013 8:14:07 PM UTC): I see at least the the minimized snippet crashing from 2.10.0-M1 until the present day.
|
@retronym said (edited on May 7, 2013 6:28:40 AM UTC): |
@retronym said: class LM {
class Node[B1]
// crash
val g: (CC => Any) = {
case CC(tttt) =>
// tttt.##
new tttt.Node[Any]()
}
} |
@vigdorchik said: |
@paulp said: class LM {
class Node[B1]
case class CC(x: LM)
// crash
val g: (CC => Any) = {
case CC(tttt) =>
// tttt.##
new tttt.Node[Any]()
}
}
|
@retronym said: https://github.com/retronym/scala/compare/ticket/7459 It still leaves unsubstituted references in cases where the 'to' trees in the substitution are Selects, rather than simple Idents. object Test extends App {
class C { class D }
case class FooSeq(x: Int, y: String, z: C*)
FooSeq(1, "a", ???) match {
case FooSeq(1, "a", x@_* ) =>
null.asInstanceOf[x.type]
}
} case <synthetic> val x1: Test.FooSeq = Test.this.FooSeq.apply(1, "a", scala.this.Predef.???);
case8(){
if (x1.ne(null))
{
<synthetic> val p2: Int = x1.x;
<synthetic> val p3: String = x1.y;
if (1.==(p2))
if ("a".==(p3))
matchEnd7(null.asInstanceOf[x.type])
else
case9()
else
case9()
}
else
case9()
}; I'm going to assign to Adriaan for an opinion. |
@vigdorchik said: |
@retronym said: It's not a regression, so I don't think this blocks 2.10.2. But we should fix ASAP. Adriaan is travelling right now, which is why he hasn't had a chance to comment. |
@vigdorchik said: |
@retronym said: |
@retronym said: |
With the following tail-recursive version of ListMap.remove:
the exception is raised:
The text was updated successfully, but these errors were encountered: