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
Compiler crash: can't convert from REF(anonymous class anon$1) to REF(anonymous class anon) #6648
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6648?orig=1
|
@paulp said: |
Ross A. Baker (rossabaker) said: |
Ross A. Baker (rossabaker) said: |
@paulp said:
|
@paulp said: < def <init>($outer: anonymous class LoopTest$transformer1$$anonfun$1$$anonfun$apply$1): anonymous class $anonfun$$anon = {
---
> def <init>($outer: anonymous class LoopTest$transformer1$$anonfun$1$$anonfun$apply$1): anonymous class LoopTest$transformer1$$anonfun$1$$anonfun$apply$1$$anon$1 = { |
@retronym said: abstract class Node extends NodeSeq
trait NodeSeq extends Seq[Node]
object NodeSeq {
implicit def seqToNodeSeq(ns: Seq[Node]): NodeSeq = ???
}
class Transformer {
def apply(nodes: Any): Any = ???
}
class LoopTest {
def foo[B, That](f: Seq[B])(implicit bf: scala.collection.generic.CanBuildFrom[Seq[Int], B, That]): That = ???
object transformer1 extends Transformer {
// Adding explicit type arguments, or making the impilcit view
// seqToNodeSeq explicit avoids the crash
foo {
// These both avoid the crash:
// {val t = new Transformer {}; t.apply(null)
// new Transformer().apply(null)
new Transformer {}.apply(null)
null: NodeSeq
}: NodeSeq
}
} |
@retronym said (edited on Nov 11, 2012 1:12:21 PM UTC): This will fix it: https://github.com/retronym/scala/compare/ticket/6648 But I expect we can do a bit better, seems like it should be handled in the existing By resetting that return type, we only end up with one Before:
After:
|
@retronym said (edited on Nov 11, 2012 1:21:00 PM UTC): |
@retronym said: |
The attached file compiles under Scala 2.9.2, crashes under 2.10.0-RC2 and the latest snapshot (2.10.0-20121104-170503-8b598436f6). Test case is a simplifed version of Scalate's LoopTest.
The text was updated successfully, but these errors were encountered: