Why is it that when I declare and initialize a variable using var
, it's inferred type is nullable?
I've inserted a picture showing the object and Visual Studio's Tooltip.
I would expect it's type to be object obj
and not object? obj
.
Project Setup excerpt
<PropertyGroup>
<LangVersion>9</LangVersion>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
I'm running Visual Studio 2019 (16.8.3) and Resharper is not installed.