You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scalac complains about that it can't convert the method to a function value, because it deems it to have a dependent type. At first glance, that seems correct. However, the following works:
defmapWithFoo[A, B](as: List[A])(implicitfoo: Foo.Aux[A, B]) =
as map (a => foo.f(a))
As you can see, the "dependent" return type Repr is actually bound to B, so eta-expansion could be done.
Use case: shapeless 2.0.0-M1. Previously, the FooAux types were proper traits, so no dependent types involved. Now, they are type aliases in the style of Foo.Aux.
Consider this snippet:
scalac complains about that it can't convert the method to a function value, because it deems it to have a dependent type. At first glance, that seems correct. However, the following works:
As you can see, the "dependent" return type
Repr
is actually bound toB
, so eta-expansion could be done.Use case: shapeless 2.0.0-M1. Previously, the
FooAux
types were proper traits, so no dependent types involved. Now, they are type aliases in the style ofFoo.Aux
.Related to #4751.
The text was updated successfully, but these errors were encountered: