scala> class Foo[T]
defined class Foo
scala> def foo[T](): Foo[T] = new Foo
foo: [T]()Foo[T]
is working, however, when we add a refinement, it doesn't:
scala> def bar[T](): Foo[T] { type U } = new Foo { type U = Int }
<console>:11: error: type mismatch;
found : Foo[Nothing]{type U = Int}
required: Foo[T]{type U}
def bar[T](): Foo[T] { type U } = new Foo { type U = Int }
as a workaround, it is needed to specify the type explicitly:
scala> def baz[T](): Foo[T] { type U } = new Foo [T] { type U = Int }
baz: [T]()Foo[T]{type U}
is working, however, when we add a refinement, it doesn't:
as a workaround, it is needed to specify the type explicitly:
(this issue was found while working on #9361)