zls
zls copied to clipboard
The type inference of std.json.parseFromSlice is broken
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