You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a[1..4] should be a pointer *const [3]i32, not a slice []i32, As shown in the attached screenshot
const std = @import("std");
pub fn main() !void {
const a = [_]i32{ 1, 2, 3, 4, 5 };
const b = a[1..4]; // it should be a pointer *const [3]i32, not a slice []i32
std.debug.print("{}\n", .{@TypeOf(b)});
var end: usize = 0;
end = 4;
const c = a[1..end];
std.debug.print("{}\n", .{@TypeOf(c)});
}
The text was updated successfully, but these errors were encountered:
vscode: 1.89.0
vscode-zig: v0.5.7
os: MacOS 14.4.1 (23E224)
a[1..4]
should be a pointer*const [3]i32
, not a slice[]i32
, As shown in the attached screenshotThe text was updated successfully, but these errors were encountered: