-
Notifications
You must be signed in to change notification settings - Fork 53
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
bugs: list returns wrong results (likely bug in drop function) #64
Comments
simplified the first bug to just two drops: const L = require("list")
let f = L.list()
for (let i=0;i<1329;i++) {
f = L.append(i, f);
}
const xx = L.drop(3, L.drop(201, f))
console.log(L.first(xx))
console.log(L.nth(0, xx))
-- sanity check
const xx1 = L.fromArray(L.toArray(xx));
console.log(L.first(xx1))
console.log(L.nth(0, xx1)) output is =>
|
Thank you for reporting the issue @emmanueltouzery. I'm looking into it! |
See #65. I've found the bug and reproduced it with a smaller test case. I'd love to get your feedback on the alternative solution I mention in the PR 😄 Thanks again for reporting the issue with a nice and simple test case 👍 |
did you check that your fix fixes both issues reproduced through the first script? The second issue from the first script may be independent because |
No, I missed that there were two parts and I only tested with the second code. I'll take a look at the other problem as well 😄 |
yes unfortunately there are two bugs, I ran the test script from your PR branch:
This kind of bugs seem like showstoppers to me :-( |
You didn't forget about other bug did you? Closing the bug makes it unclear |
Don't worry, I didn't 😄 I actually didn't close the issue myself. GitHub automatically closed the issue because I merged the PR #65. Since the PR contained the text "Fixes #64" GitHub thought the issue was fixed.
I agree. List shouldn't have any bugs. See #66. That should fix the issue. |
Yes in general in the commits i say "ref #bug" if it's related to the bug without fixing it. Great otherwise! Hope you make a bugfix release soon :-) |
That's a great tip! Both issues should be fixed now so I'll close 😄 |
Sure let's close. Just lobbying for a bugfix release when possible :-) |
I've just released a new version 👍 |
noticed this in uses from my prelude.ts library :-(
list appears to get confused by a series of operations, let's say its internal structures get corrupted, and it returns wrong results.
I made a reproduction script:
The output is:
The text was updated successfully, but these errors were encountered: