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.
2 parents 23f1845 + 0ff2cd0 commit 2fadaedCopy full SHA for 2fadaed
tests/neg/i5418.scala
@@ -0,0 +1,14 @@
1
+class Test {
2
+ class Tree[A]
3
+
4
+ def fromOrderedKeys[A](xs: Iterator[A]): Tree[A] = ???
5
6
+ def from[E](it: Iterable[E]): Tree[E] =
7
+ it match {
8
+ case r: Range =>
9
+ val it = r.iterator
10
11
+ // instantiation of covariant GADTs is unsound
12
+ fromOrderedKeys(it) // error: type mismatch: found: Iterator[Int](it), required Iterator[E]
13
+ }
14
+}
0 commit comments