zls icon indicating copy to clipboard operation
zls copied to clipboard

The type inference of std.json.parseFromSlice is broken

Open Decrabbityyy opened this issue 4 months ago • 0 comments

Zig Version

0.15.1

ZLS Version

0.15.0

Client / Code Editor / Extensions

vscode with ziglang plugin

Steps to Reproduce and Observed Behavior

const std = @import("std");
const json = std.json;

test "json test" {
    const testing = std.testing;
    const allocator = testing.allocator;
    const json_example = try json.parseFromSlice(json.Value, allocator, "{\"key\": [1,2,3]}", .{});
    @compileLog(@TypeOf(json_example));
}

input code in editor,it will hint json_example is unknown

Expected Behavior

json_example can be parsed normally as Parsed(Value)

Log Output


Decrabbityyy avatar Aug 25 '25 09:08 Decrabbityyy