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

Comptime string concatenation ignores slice bounds #1362

Closed
tgschultz opened this Issue Aug 10, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@tgschultz
Contributor

tgschultz commented Aug 10, 2018

const std = @import("std");
const debug = std.debug;

test "slice bounds ignored in comptime concatenation"
{
    const bs = comptime blk:
    {
        const b = c"111";
        break :blk b[0..1];
    };
    const str = "" ++ bs ++ "2345";
    debug.assert(str.len == 5);
}
Test 1/1 slice bounds ignored in comptime concatenation...assertion failure

@andrewrk andrewrk added this to the 0.3.0 milestone Aug 10, 2018

@andrewrk andrewrk added the bug label Aug 10, 2018

@andrewrk andrewrk closed this in 9e5cd43 Sep 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment