zig icon indicating copy to clipboard operation
zig copied to clipboard

Zig often fails to compile successfully but does not report an error

Open jingsupo opened this issue 3 years ago • 0 comments

Zig Version

0.10.0-dev.4476+0f0076666

Steps to Reproduce

const std = @import("std");

pub fn main() !void {
    std.debug.print("begin...\n", .{});
    std.debug.print("{}\n", .{std.mem.bytesToValue(usize, &[_]u8{ 49, 48, 48 })}); //not work
    std.debug.print("{!}\n", .{std.fmt.parseInt(usize, &[_]u8{ 49, 48, 48 }, 0)}); //work
}

Expected Behavior

std.debug.print("{}\n", .{std.mem.bytesToValue(usize, &[_]u8{ 49, 48, 48 })}); //not work Compilation failed with error

Actual Behavior

std.debug.print("{}\n", .{std.mem.bytesToValue(usize, &[_]u8{ 49, 48, 48 })}); //not work Compilation failed without any error

Zig often fails to compile successfully but does not report an error, why?

jingsupo avatar Oct 22 '22 16:10 jingsupo