Closed
Description
Minimized code
trait Foo[F[_]]
trait Top {
type F[X]
def foo: Foo[F]
}
trait Left extends Top
trait Right extends Top {
trait F[X]
def foo: Foo[F] = new Foo[F] {}
}
class Bottom extends Left with Right
Output
[error] -- Error:
[error] 17 |object Bottom extends Left with Right
[error] | ^
[error] |method foo in trait Right is not a legal implementation of `foo` in class Bottom
[error] | its type => Foo[Bottom.F]
[error] | does not conform to => Foo[Bottom.F] & Foo[Bottom.F]
Expectation
The expected type for member foo
in Bottom
should be reduced to Foo[F]
instead of Foo[F] & Foo[F]
, and the code would compile.