-
Notifications
You must be signed in to change notification settings - Fork 548
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
feat(corelib): range IndexView #6971
base: main
Are you sure you want to change the base?
Conversation
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion
corelib/src/test/array_test.cairo
line 15 at r1 (raw file):
fn test_array_out_of_bound_1() { let arr = array![10, 11, 12]; arr[3_usize];
@orizi there's an issue with type inference that forced me to specify that this index is a usize. Would you be able to TAL?
Code quote:
arr[3_usize];
1a4c283
to
fa338af
Compare
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @cairoIover and @orizi)
corelib/src/test/array_test.cairo
line 15 at r1 (raw file):
Previously, cairoIover wrote…
@orizi there's an issue with type inference that forced me to specify that this index is a usize. Would you be able to TAL?
this is the first instance where we have 2 options for an Index
index type
- we need to find the exact culprit.
I'd postpone this PR now - as .slice(...)
already exists.
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @orizi)
corelib/src/test/array_test.cairo
line 15 at r1 (raw file):
Previously, orizi wrote…
this is the first instance where we have 2 options for an
Index
index type
- we need to find the exact culprit.I'd postpone this PR now - as
.slice(...)
already exists.
Sure - I'll keep this open until then. Just so that I know is it something you plan on investigating in the near future?
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @cairoIover and @orizi)
corelib/src/test/array_test.cairo
line 15 at r1 (raw file):
Previously, cairoIover wrote…
Sure - I'll keep this open until then. Just so that I know is it something you plan on investigating in the near future?
i hope to.
but i'm yet to be sure we will have a proper solution any time soon (because it really depends on the exact cause of the problem)
Adds
IndexView
toArray
andSpan
, enabling the following syntax:assert_eq!(arr[2_usize..4] == [3, 4].span());