Skip to content

Commit 6086e57

Browse files
committed
test: add in a regression test for #11681
This adds in both the original given example and a further minimized one. [skip community_build] closes #11681
1 parent b0ccf40 commit 6086e57

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/pos/i11681.scala

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)