Compiler warnings about unused variables
I have a simple program
On my vscode, only
c
is underlined with this error: The variable 'c' is assigned but its value is never used
Why is b
not underlined? I mean it's dimmed but why isn't this a compiler warning as well?6 Replies
The warning is issued if and only if the assigned value is a compile-time constant.
i see thanks. do you know if there's any setting i can enable that detects
b
being unusedb
is already inspected and code analysis does tell that it is not being usedwhat i mean is maybe it shows up as a compile-time warning
You can configure the severity of this inspection
It is not a compiler warning, and you can't force it to be one
You can however configure IntelliSense or ReSharper to change its severity
ok i'll look into it, thanks