Skip to content

Commit 2ad2879

Browse files
authored
Merge pull request #6166 from dotty-staging/fix-6119
Fix #6119: add test
2 parents efa691c + 7c24e54 commit 2ad2879

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/pos/i6119.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Test {
2+
def to[Col[_]](factory: Factory[Int, Col[Int]]): Col[Int] = ???
3+
4+
to(Vector)
5+
6+
type Factory[-A, +C] = scala.collection.generic.CanBuildFrom[Nothing, A, C] // Ideally, this would be an opaque type
7+
8+
implicit def fromCanBuildFromConversion[X, A, C](x: X)(
9+
implicit toCanBuildFrom: X => scala.collection.generic.CanBuildFrom[Nothing, A, C]): Factory[A, C] = ???
10+
11+
implicit def genericCompanionToCBF[A, CC[X] <: scala.collection.GenTraversable[X]](
12+
fact: scala.collection.generic.GenericCompanion[CC]): scala.collection.generic.CanBuildFrom[Any, A, CC[A]] = ???
13+
}

0 commit comments

Comments
 (0)