v-analyzer
v-analyzer copied to clipboard
segfault when using generics
Describe the bug
v-analyzer crashes when working with generics. the issue happens more often in neovim than in vscode.
Expected Behavior
keeps running
Current Behavior
segfault
Reproduction Steps
E.g. in vlib/x/json2/decoder.v v-analyzer won't work - tested in VSCode as well as in neovim. The connection to the server closes
signal 11: segmentation fault
addr2line: '[0x4e6756]': No such file
[0x4e6756]
addr2line: '[0x5babc0]': No such file
...
[Error - 1:32:13 AM] Connection to server got closed. Server will not be restarted.
[Info - 1:35:48 AM] v-analyzer version: 0.0.4-beta.1, commit: cae4a2c, OS: linux x64
In VSCode apparently below can be handled (I think the server restarts itself here), while in neovim a crash without restart seems more likely.
struct Foo[T] {
foo T
}
// If it doesn't crash on paste try to remove and add the `bar T` parameter`
fn foo[T](bar T) {
println(bar)
}
Possible Solution
No response
Additional Information/Context
might be an issue with V itself
Environment details (v doctor output)
linux, amd64
Editor name
nvim, vscode
v-analyzer Version
nightly
VS Code Extension Version
No response
I discovered something similar today:
I have the following function:
fn test[T](data T) {
println(data)
}
When I hover over the "T" after "data" with the mouse in VS Code, the language server crashes.
Version:
v-analyzer version: 0.0.5, commit: ef4243a, OS: windows x64
v-analyzer build with V 7c3c589
v-analyzer build at 2024-11-13 10:44:06
Client / Editor: Visual Studio Code 1.95.3
Error:
print_backtrace_skipping_top_frames is not implemented
[Error - 3:30:53 PM] Connection to server got closed. Server will not be restarted.