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
I'm not sure if this is really a bug but atleast it seems like unintended consequence.
Using MyEnumeration.values.map(p => (p -> DoSomehtingWith(p)) causes diverging implicit expansion error.
This used to work on 2.8 and 2.9 and you can go around with MyEnumeration.values.toList.map but that seems strange and unnecessary.
@adriaanm said (edited on Aug 7, 2012 9:00:27 AM UTC):
This is a library issue, probably caused by scala/scala@2d0f82898d
newCanBuildFrom for SortedSet is competing with the normal canBuildFrom.
Since there's an easy workaround (add a toList) and unlikely to be the compiler's fault, lowering priority and re-assigning.
@szeiger said:
I wish I knew what's going on. This canBuildFrom stuff is a hack (overriding newCanBuildFrom in SortedSet) upon a hack (needing both canBuildFrom and newCanBuildFrom in the first place) and I don't fully understand the latter.
The reason for needing the SortedSet hack is that the standard canBuildFrom for SortedSets only works for sets with a user-specified ordering (even though SortedSet itself has no such requirement).
I think it's a legitimate bug that should be fixed but off the top of my head I can't think of a good solution that won't further complicate the implementation (with the risk of creating new bugs in slightly different situations).
I'm not sure if this is really a bug but atleast it seems like unintended consequence.
Using MyEnumeration.values.map(p => (p -> DoSomehtingWith(p)) causes diverging implicit expansion error.
This used to work on 2.8 and 2.9 and you can go around with MyEnumeration.values.toList.map but that seems strange and unnecessary.
More verbose explanation here: http://stackoverflow.com/questions/9487425/enumeration-and-mapping-with-scala-2-10
The text was updated successfully, but these errors were encountered: