Description
See bug #1 in the context of this mailing list post:
http://groups.google.com/group/shapeless-dev/browse_thread/thread/1f26830027f3517
"1. It will not choose the correct implicit function for any type after
the first type in the destination disjunction."
The link below is an improved implementation that has the same bug, is less complex to follow, and thus if I am correct probably demonstrates that the problem is not peculiar to a simulated union type and rather general to implicits and compound type leaf nodes (i.e. those after the first with
, e.g. the D[String]
in D[D[Int] with D[String]]
), when the implicit matching is in the contravariant direction. The neg
implicit is chosen for D[D[Int]]
but not for D[D[String]]
.
P.S. There is a duplicate syntax-highlighted version buried nearer to the bottom of the following stackoverflow answer: