zls
zls copied to clipboard
Hover showing incorrect type on nested `if` payload
Zig Version
0.12.0-dev.2500+c085c6ecd
Zig Language Server Version
0.12.0-dev.365+a8a83b6
Client / Code Editor / Extensions
NVIM v0.9.4 with Lspconfig
Steps to Reproduce and Observed Behavior
Hover on a nested payload variable to observe the type.
When printing the type of number using @TypeOf I get the correct result.
I have shared a small repo on which you should be able to execute the code and see by yourself:
Otherwise here is a screenshot:
And a gist to the main.zig file: Reproducible Test Case
Expected Behavior
The hover information for number should indicate its type as *NumberLiteralExpression.
Actual Behavior:
The hover information for number incorrectly indicates its type as *UnaryExpression.
Relevant log output
No response