Closed
Description
The following code compiles with Scala 2.x
package bar
import java.nio.file._
import java.util.stream.Collectors
object foo {
Files.walk(Paths.get("")).collect(Collectors.toList[Path])
}
while dotc at commit 5093126 reports a type error
-- [E007] Type Mismatch Error: foo.scala:5:36 ----------------------------------
5 | Files.walk(Paths.get("")).collect(Collectors.toList[Path])
| ^^^^^^^^^^^^^^^^^^^^^^^
| found: java.util.stream.Collector[java.nio.file.Path, _,
| java.util.List[java.nio.file.Path]
| ]
| required: java.util.stream.Collector[_ >: java.nio.file.Path, A, R]
|
| where: A is a type variable
| R is a type variable
one error found