What does a gray underline mean in Rider?

Some variables get a gray underline - I can't find any references that mention gray underline...

root and tempDirectory are fine - but currentDirectory is not? The variable is used and reassigned to different values later in code. What gives?

  - Sean


Comment actions Permalink

Hi Sean,

Hover this variable with the mouse cursor, a popup should appear with the information about this case.

Also, you can place a cursor on this var and press Alt + Enter and check what quick fixes will be suggested.




Comment actions Permalink

I found the answer here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000395439-Underlined-variables-

Underlined (in gray) variables are variables or parameters that are reassigned. So, in the code example below, if you remove the "= null" from the first assignment, the gray lines go away.


Please sign in to leave a comment.