Closed
Description
minimized code
object Example extends App {
def assertLazy[A, B](f: (=> A) => B): Boolean = ???
def fromEither[E, A](eea: => Either[E, A]): Unit = ???
lazy val result = assertLazy(fromEither)
println("It compiles!")
}
Found: Any
Required: Either[Any, Any]
expectation
I would expect this code to compile as it does on Scala 2. assertLazy
is completely polymorphic in its type other than being by name, which fromEither
satisfies, so this should work. The issue appears to be related to the fact that the argument to fromEither
has two type parameters. If I try it with an argument with only one parameter it works correctly.