Skip to content
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

type hints is incorrect #203

Closed
yar999 opened this issue May 6, 2024 · 1 comment
Closed

type hints is incorrect #203

yar999 opened this issue May 6, 2024 · 1 comment
Labels
lsp Issue with language server integration

Comments

@yar999
Copy link

yar999 commented May 6, 2024

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 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)});
}

hints

@Vexu Vexu added the lsp Issue with language server integration label May 6, 2024
@Techatrix
Copy link
Collaborator

This issue is already being tracked by ZLS in zigtools/zls#1230

@Techatrix Techatrix closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lsp Issue with language server integration
Projects
None yet
Development

No branches or pull requests

3 participants