ReSharper has two types of warnings when the type can be inferred. You get a squiggly line when the type of your variable is exactly the same as the instantiated type:
Dictionary<long, Profile> dicProfile = new Dictionary<long, Profile>();
And you get a shorter underscored line when the variable's type is a base class of the instantiated type (like the IDictionary<>
interface in this case):
IDictionary<long, Profile> dicProfile = new Dictionary<long, Profile>();
Whether you want this, is personal preference. I like this feature, especially in the first case, because it seems redundant to me to explicitly declare the type of a variable when it can be inferred.
If you don't want this you can turn this of by going here:
ReSharper -> Options -> Code Inspection -> Inspection Severity -> Language Usage Upportunities -> Use 'var' keyword when initializer explicitly declares type
And here:
ReSharper -> Options -> Code Inspection -> Inspection Severity -> Language Usage Upportunities -> Use 'var' keyword when possible