ReSharper is most probably just doing lexical analysis here and nothing deeper.
Since DateTimeFormatInfo
is a class, a variable of this type can be null
. Which means that the instance returned by DateTimeFormatInfo.CurrentInfo
can be a null
reference.
That's the error you are getting.
ReSharper doesn't understand that the method was coded such that it will not return a null
reference, so it gives a warning.
Don't take the messages from ReSharper as scripture...