Closed
Description
This was discovered in scala/collection-strawman#117 (comment). Simplified test case using the current Dotty master:
scala> trait SortedMap[K, V] {
def collect[B](pf: PartialFunction[(K, V), B]): Int = 0
def collect[K2 : Ordering, V2](pf: PartialFunction[(K, V), (K2, V2)]): Int = 0
def foo(xs: SortedMap[String, scala.Int]) = xs.collect { case (k, v) => 1 }
}
-- [E080] Syntax Error: <console>:7:61 -----------------------------------------
7 | def foo(xs: SortedMap[String, scala.Int]) = xs.collect { case (k, v) => 1 }
| ^
| missing parameter type for parameter x$1 of expanded function x$1 =>
| x$1 @unchecked match
| {
| case (k, v) =>
| 1
| }, expected = ?
This should have been enabled by #2015. My original implementation for Scala 2.13 in scala/scala#5698 had bugs which are fixed by scala/scala#5975. It could be a similar problem in Dotty.
Metadata
Metadata
Assignees
Labels
No labels