Closed
Description
Found in the 2.13 std lib:
class Test {
class Tree[A]
class TreeSet[A](tree: Tree[A])
def fromOrderedKeys[A](xs: Iterator[A]): Tree[A] = ???
def from[E](it: Iterable[E]): TreeSet[E] =
it match {
case r: Range =>
val it = r.iterator
new TreeSet[E](fromOrderedKeys(it))
}
}
-- [E007] Type Mismatch Error: Test.scala:11:39 --------------------
11 | new TreeSet[E](fromOrderedKeys(it))
| ^^
| found: Iterator[Int](it)
| required: Iterator[E]
|
one error found