-
Notifications
You must be signed in to change notification settings - Fork 40
Safer array primitives #1220
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
Safer array primitives #1220
Conversation
0a92742 to
8b71915
Compare
|
For some reason the stdlib tests go into an endless loop now. |
d023732 to
2a11f6c
Compare
| } | ||
|
|
||
| /// Allocate a new, empty dynamic array | ||
| /// Aallocatellocate a new, empty dynamic array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo 👀
| a.checkOutOfBounds(-1) | ||
| a.add(1) | ||
| a.add(2) | ||
| a.checkOutOfBounds(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we somehow have a test for something like this, still? Even if just checking that it panics afterwards - for the resizable arrays, it might return the value at index 2 still (if capacity is >2) even if the length is just 2. And this might be hard to catch otherwise. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd personally be fine with the resizable arrays still using Exception[OutOfBounds] everywhere (and perhaps later a fail instead).
38e9a79 to
94ec233
Compare
94ec233 to
bcc6346
Compare
Uh oh!
There was an error while loading. Please reload this page.