Open neontorrent opened 4 years ago
To further minimize: it's irrelevant that it's a case class.
Dotty (0.27.0-RC1) 💪s it:
scala> case class Foo[+CC[_]](a: CC[Int], b: CC[Int])
// defined case class Foo
scala> Foo(scala.collection.mutable.ListBuffer(1), scala.collection.mutable.ListBuffer.empty)
val res0: Foo[scala.collection.mutable.ListBuffer] = Foo(ListBuffer(1),ListBuffer())
Related to #10428?
reproduction steps
using Scala 2.13.x,
problem
When a return value of SAM method contains a high order type in the class to be deduced, Scala cannot seem to deduce it properly, unless the high order type is explicitly specified.
Scala compiler should be able to deduce the type argument since the SAM trait already explicitly defined the full return type
EDIT
It turns out not related to SAM, because the following also fails: