zls
zls copied to clipboard
indexing a string has unknown type
Zig Version
0.14.0-dev.367+a57479afc
Zig Language Server Version
0.14.0-dev.54+adf3b83
Client / Code Editor / Extensions
nvim 0.10.0 with nvim-lspconfig
Steps to Reproduce and Observed Behavior
const s = "hello";
const b = s[0];
_ = b;
^ b has unknown type.
Explicitly specifying the string type fixes the issue.
pub fn main() void {
const string = "Hello, world!";
for (string) |byte| {
_ = byte;
}
for ("hello") |byte| {
_ = byte;
}
}
Expected Behavior
Type of the indexed value should be u8.
Relevant log output
No response