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

compile time array concatenation results in wrong type for `[]const u8` operands #866

Closed
andrewrk opened this Issue Mar 29, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@andrewrk
Member

andrewrk commented Mar 29, 2018

const std = @import("std");

comptime {
    var a: []const u8 = "aoeu";
    var b: []const u8 = "asdf";
    const c = a ++ b;
    std.debug.assert(std.mem.eql(u8, c, "aoeuasdf"));
}

gives

/home/andy/downloads/zig/build/test3.zig:7:38: error: expected type '[]const u8', found '&const u8'
    std.debug.assert(std.mem.eql(u8, c, "aoeuasdf"));
                                     ^

@andrewrk andrewrk added the bug label Mar 29, 2018

@andrewrk andrewrk added this to the 0.3.0 milestone Mar 29, 2018

@andrewrk andrewrk changed the title from compile time string concatenation results in wrong type for `[]const u8` operands to compile time array concatenation results in wrong type for `[]const u8` operands Mar 29, 2018

@andrewrk andrewrk closed this in 032fccf Mar 29, 2018

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