Skip to content

stage2: concat/mult of slices should yield a ptr to an array #11270

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

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

topolarity
Copy link
Contributor

hundo p for test/behavior/slice.zig

@topolarity
Copy link
Contributor Author

topolarity commented Mar 23, 2022

Before fixing, this test failure showed a src loc in the wrong file (thanks to @mitchellh for the heads up):

/home/topolarity/repos/zig/stage2/lib/zig/std/mem.zig:548:45: error: expected []const u8, found [8]u8
    try testing.expect(lessThan(u8, "abcd", "bee"));
                                            ^

I plan to try to fix that up in another PR soon

@andrewrk
Copy link
Member

andrewrk commented Mar 23, 2022

I'd like to re-evaluate this as part of the language spec - this test precedes the changes from #863 which made slices with comptime-known start and end indexes return single-pointers to arrays instead of slices. In light of this I think the test cases should perhaps be changed to have ++ and ** always return single-pointers to arrays.

What do you think?

@topolarity topolarity changed the title stage2: concat/mult of slices should yield another slice stage2: concat/mult of slices should yield a ptr to an array Mar 23, 2022
@topolarity
Copy link
Contributor Author

Works for me! Updated with the new behavior 👍

@andrewrk andrewrk merged commit 6fc07f4 into ziglang:master Mar 23, 2022
@topolarity topolarity deleted the array-concat-mult branch March 23, 2022 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants