Writing the following code in visual studio 2022
public class MyClass { }
public bool TrySomething (out MyClass myClass)
{
myClass = null;
return false;
}
Makes it complain about "possible non-nullable"
But it's a class parameter, how could this be a non-nullable? what am I missing?
NOTE: rider doesn't complain about with, now I want to know if the rider is correct or if I had suppressed some warning kind and don't remember
EDIT: added the project file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="OpenTK" Version="4.7.4" />
<!--<PackageReference Include="OpenTK.WinForms" Version="4.0.0-pre.6" />-->
</ItemGroup>
<ItemGroup>
<Reference Include="OpenTK.WinForms">
<HintPath>dlls\OpenTK.WinForms.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>