-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy
doesn't propagate type-member info about derived type-class instances
#902
Comments
A longer, mostly-unrelated write-up of my upstream use-case that led to this issue is in this gist, along with a previous version of this issue from when I'd not narrowed down the problem as much. |
Lazy
doesn't propagate type-member info about derived type-class instances
Hmm |
I don't totally know what that means, but it sounds plausible! Is there a different way to propagate output-types through (potentially recursive) derivations? |
I can check tomorrow but maybe it's a type inference issue (e.g. doing an extra call to generic constructor such as The solution is usually to use an extra type parameter and the |
I think that @joroKr21 is looking in the right place. Try, implicit def lazy_ [T, O](implicit g: G[T, L], tc: Lazy[Aux[L, O]]): TC.Aux[T, O] = null |
Confirmed that implicit def lazy_ [T, O](implicit g: G[T, L], tc: Lazy[TC.Aux[L, O]]): TC.Aux[T, O] = null This is not an issue. |
scalafiddle
Scala 2.12.8, Shapeless 2.3.3 (also tried from #797 branch)
Description
Derivations involving
shapeless.Lazy
don't correctly propagate type-member info in derived type-class instances.Source
Console
The difference between
res2
/res3
(Lazy
summons that don't specify the output type, and therefore work) andres0
/res1
("eager" summons that omit and specify the output type, resp.) are intriguing. The latter seem to keep an awareness of theAux
alias and origin of the output type (TC.base.Out
), whereas the former seem to have a subtly different representation.The text was updated successfully, but these errors were encountered: