-
Notifications
You must be signed in to change notification settings - Fork 757
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
class library: fix issues with asPairs, asAssociations, asDict #3101
Conversation
results in:
|
yes, I also found them. They are fixed in #3020. Maybe you can take a look if those fixes there are sufficient? I'd like to avoid merge conflicts (well, if possible). |
Just from looking at it, your fix seems to do the same, and is more elegant so I say we use your fix. |
@kisielk it is intended to fail for unordered collections, apart from dictionaries. |
95b036e
to
4b69e81
Compare
@telephon Ok, copied your fix. Also added some tests. Btw 'TestDictionary.run' fails strangely with ERROR: Message 'assert' not understood RECEIVER: Dictionary[ ]. Seems to have something with using a try block in the assert ? |
@telephon I'm curious why that's the case? It could certainly work for sets by returning pairs of elements with themselves or associations to elements to themselves. I guess that's probably out of scope of this ticket though. |
it could work for sets of associations, but not for sets of keys and values. Currently the definition of an array of associations is (trustingly) that the first element is an association. There is no first element for a set. As you say, it is thinkable, but a little bit out of scope. |
@miguel-negrao yes I noticed, i have no idea what causes it |
Any reason not to merge this ? |
merge what? this #3101 pr? |
looks good |
4b69e81
to
d278cb6
Compare
…d collection size
Added newline. |
Build status appears as failed, it says 10 Tests failed, but I can't find which tests failed... anyone has any pointers ? |
I was getting strange results with asPairs and asAssociations and I think I found some bugs. Some elements were missing after doing asPairs or asAssociations.
When going from a dictionary to an array of associations the size should stay the same. the method in Collection was being called which was halving the size:
When going from an array of associations to an array of pairs the size should double, and the code in Collection was halving it.