How to suppress "local variable 'foo' can be uninitialized" Follow
Answered
There is a "local variable 'foo' can be uninitialized" if I write like
foo if boolean_value
p foo
How can I suppress this warning?
I couldn't find configuration for it.
Please sign in to leave a comment.
+1 ... Rubymine is complaining the value may be uninitialized when using the safe navigation operator or wrapping the variable access inside an if statement.
Hello, sorry for delay! could you please attach the screenshots of the code with inspection? I'm unable to reproduce unfortunately.
+1
I can't suppress it, too.
@Mrtmrt15xn,
would it be possible to provide a code sample?
@Olga-Kuvardina
See the image below.
I know that the variable can be uninitialized. But I just want to hide the warning.
@Mrtmrt15xn, you can invoke intention action (Alt+Enter) and suppress that inspection for the method.
Thanks. It works.