We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0ccf40 commit 6086e57Copy full SHA for 6086e57
tests/pos/i11681.scala
@@ -0,0 +1,28 @@
1
+// https://github.com/lampepfl/dotty/issues/11681
2
+
3
+import scala.collection.Factory
4
5
+final case class Gen[+A]() {
6
+ def take[C[X] <: Iterable[X], B](
7
+ n: Int
8
+ )(implicit w: A <:< C[B], f: Factory[B, C[B]]): Gen[C[B]] =
9
+ Gen()
10
+}
11
12
+object Usage {
13
+ def expected: Gen[List[Int]] =
14
+ Gen[List[Int]]().take(3)
15
16
17
+object example:
18
+ type G[A]
19
+ given G[H[Int]] = ???
20
21
+ trait H[X]
22
+ object H {
23
+ given H[Int] = ???
24
+ }
25
26
+ def take[C[_]](using w: G[C[Int]], f: C[Int]) = ???
27
28
+ def test = take
0 commit comments