-
Notifications
You must be signed in to change notification settings - Fork 530
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
fix bug in hlist.{Intersection, Union} #563
Conversation
Fails mima check — this is tricky, the patch not bincompat with existing, but existing is buggy. :-\ |
Hi @refried, thanks for fixing this, your changes are LGTM! Regarding your 2nd question, I think |
About MiMa, it is possible keep binary compatibility. You just have to keep the former methods as is, possibly modifying a bit their implementation, but removing their This way, code compiled against older versions of shapeless will still find the methods they're looking for at runtime, and code compiled against the newer version will only find the newest methods, which are the only ones flagged as implicit. |
+1 to @alexarchambault's advice ... I'll merge when MiMa passes ... thanks! :-) |
@alexarchambault @milessabin Ok, I can make that MiMa change, but please advise/confirm: the binary-compatible version will necessarily continue to be buggy, which is pretty scary to me. (The fix was to add the additional witness.) My instinct to add a Do I add |
@refried As the methods kept for binary compatibility don't have the I don't mind about adding |
@alexarchambault Sure, I understand that — I just wished there was a way to warn the person linking against the old version; but I guess there isn't, and they wouldn't discover a bincompat issue until runtime. I pushed the update, so fingers crossed! 😄 |
LGTM. Many thanks ... merging :-) |
fix bug in hlist.{Intersection, Union}
Fix bugs described in #562.
Currently
Intersection
is witnessed by three cases:hnilIntersection
says ∅ ∩ M = ∅, which is good.hlistIntersection1
says (H :: T ∩ M) = T ∩ MhlistIntersection2
says: if H ∈ M, (H :: T ∩ M) = H :: (T ∩ (M - R))Unfortunately, (H :: T ∩ M) = T ∩ M is false if H ∉ M. This patch adds the H ∉ M condition to
hlistIntersection1
using aFilterNot.Aux[M,H,M]
witness.The patch also fixes an equivalent bug in
Union
.I had a couple additional questions:
hlistIntersection1
andhlistIntersection2
reside in the same trait now, eliminating the need forLowPriorityIntersection
?Intersection extends DepFn1
butUnion extends DepFn2
? It seems like they should be the same, but I don't know what the right answer is.