I will answer your question in detail:
fooobar.com/questions/282626 / ...
In short: the compiler detects that a local record is being written, but not read while passing through stream analysis. It deliberately suppresses the warning if the value written to the local is inconsistent. String.Empty not a constant, this field is read-only, oddly enough. But an empty string literal is a constant. That's why you see a warning for one with a literal, but not for a field.
The compiler argues that you can assign the value of an expression to unread from local to make debugging easier. We donโt want you to have to turn off โerror warningsโ every time you enter an explanatory variable to help with debugging. The fact that in this case, obviously, you are not using the variable to check the output of String.Empty , is lost in the compiler; he does not know what the semantics of field references are.
source share