summaryrefslogtreecommitdiff
path: root/test/files/pos/t6648.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2012-11-25 13:52:36 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2012-11-25 13:52:36 -0800
commit9afc00c0408e49a111f381334cbdb7fcdaa4f340 (patch)
tree9807c35aa0bc818bf487a2c93bd577e37e1adce0 /test/files/pos/t6648.scala
parent889ceade520ae5d2d1485edf2826696fa91a0e91 (diff)
parentf0e9237834d00ea9e27937e44dc8b8382be32db6 (diff)
downloadscala-9afc00c0408e49a111f381334cbdb7fcdaa4f340.tar.gz
scala-9afc00c0408e49a111f381334cbdb7fcdaa4f340.tar.bz2
scala-9afc00c0408e49a111f381334cbdb7fcdaa4f340.zip
Merge pull request #1664 from paulp/merge-2.10.x-master
Merge 2.10.x into master.
Diffstat (limited to 'test/files/pos/t6648.scala')
-rw-r--r--test/files/pos/t6648.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/files/pos/t6648.scala b/test/files/pos/t6648.scala
new file mode 100644
index 0000000000..9593ebfee9
--- /dev/null
+++ b/test/files/pos/t6648.scala
@@ -0,0 +1,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
+}
+