diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-06-19 12:05:41 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-06-19 12:05:41 -0700 |
commit | 16f53506e289ae0b9b97537e01de8fdc985ee4bf (patch) | |
tree | fa23f2f7675bc48b3d89a70e1996a9c079783ca7 /test/files | |
parent | 32d42b1264bd52578957abffe312a128ac23122b (diff) | |
parent | 47fad25adba895e8b27aee479373ea364dd316dd (diff) | |
download | scala-16f53506e289ae0b9b97537e01de8fdc985ee4bf.tar.gz scala-16f53506e289ae0b9b97537e01de8fdc985ee4bf.tar.bz2 scala-16f53506e289ae0b9b97537e01de8fdc985ee4bf.zip |
Merge pull request #750 from paulp/issue/5953
Fix for SI-5953, extension methods crasher.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t5953.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/pos/t5953.scala b/test/files/pos/t5953.scala new file mode 100644 index 0000000000..90e7d84646 --- /dev/null +++ b/test/files/pos/t5953.scala @@ -0,0 +1,16 @@ +import scala.collection.{ mutable, immutable, generic, GenTraversableOnce } + +package object foo { + @inline implicit class TravOps[A, CC[A] <: GenTraversableOnce[A]](val coll: CC[A]) extends AnyVal { + def build[CC2[X]](implicit cbf: generic.CanBuildFrom[Nothing, A, CC2[A]]): CC2[A] = { + cbf() ++= coll.toIterator result + } + } +} + +package foo { + object Test { + def f1[T](xs: Traversable[T]) = xs.convertTo[immutable.Vector] + def f2[T](xs: Traversable[T]) = xs.build[immutable.Vector] + } +} |