blob: 9593ebfee9d1ffcef7ce8cc819e86dd9d1ba5889 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
abstract class Node extends NodeSeq
trait NodeSeq extends Seq[Node]
object NodeSeq {
implicit def seqToNodeSeq(ns: Seq[Node]): NodeSeq = ???
def foo[B, That](f: Seq[B])(implicit bf: scala.collection.generic.CanBuildFrom[Seq[Int], B, That]): That = ???
}
class Transformer {
def apply(nodes: Any): Any = ???
}
object transformer1 extends Transformer {
// Adding explicit type arguments, or making the impilcit view
// seqToNodeSeq explicit avoids the crash
NodeSeq.foo {
// These both avoid the crash:
// val t = new Transformer {}; t.apply(null)
// new Transformer().apply(null)
new Transformer {}.apply(null)
null: NodeSeq
}: NodeSeq
}
|