2/2: Add enumerate() to DSLX stdlib#4022
Conversation
1f5091f to
c903b72
Compare
|
Aside from obvious updates to use Not sure yet how to repro this in a small standalone test. |
|
I believe I was able to reproduce the issue by testing with an empty array, for example: I tried to see if I could fix this with a |
77a0507 to
6c17e74
Compare
|
@erinzmoore, thank you for the test to reproduce the issue. I've added more commits to this PR to provide support for empty array enumeration:
Please let me know if this solved the issue on your side as well. |
| TypecheckSucceeds(HasNodeWithType("X", "sN[16][8]"))); | ||
| } | ||
|
|
||
| TEST(TypecheckV2Test, RangeExprEmptyRange) { |
There was a problem hiding this comment.
It seems like here and in other test files, we should keep empty range/array tests but change the assertions to expect success, and add a const_assert! in the DSLX that expects it to be empty.
We should also add tests for an empty range with the start being the max of the type, for both signed and unsigned, because there is some logic which normalizes exclusive ranges by converting them into inclusive with end + 1.
There was a problem hiding this comment.
I restored RangeExprEmptyRange test and added two more to the same file.
6c17e74 to
b3ba97c
Compare
|
@richmckeever, thank you for the review. I've rebased the code and added the suggested tests. Let me know if there's still something missing. |
|
do we also need to update documentation and samples? |
The second of two PRs responsible for migrating from the built-in enumerate, which cannot be lowered to IR.
This PR includes: removing the build-in enumerate.