-
-
Notifications
You must be signed in to change notification settings - Fork 368
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Zig Version
0.14.0-dev.3367+1cc388d52
ZLS Version
0.14.0-dev.397+30b0da02
Client / Code Editor / Extensions
Zed dev 0.175.2.r93.gd0a0303 d0a0303428bed88da0c3773740a9cd8b39d8910d
Steps to Reproduce and Observed Behavior
I want to implement this wrapper function for bitset types and zls only predicts type information after 1 layer of function call.
pub fn FBS(BS: type) type {
return struct {
bs: BS,
pub fn format(
self: @This(),
comptime fmt: []const u8,
options: std.fmt.FormatOptions,
writer: anytype,
) !void {
_ = fmt;
_ = options;
_ = writer;
std.debug.print("{}", .{self.bs.count()}); // no type-hint/auto-completion for self.bs
// ....
}
};
}
pub fn fbs(bitset: anytype) FBS(@TypeOf(bitset)) {
// auto-completion works fine here
return FBS(@TypeOf(bitset)){ .bs = bitset };
}
Expected Behavior
Ideally zls should be able to infer that self.bs
is a bitset.
Relevant log output
arrufat
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working