Type inference for out var differs by compiler (#8312)

While our CI seems happy with this line of code on master, my machine
with the 3.1 sdk is resolving it to non-nullable type and complaining
about the "= null" line later.

```
LocalWorkspace.cs(389,27): error CS8600: Converting null literal or
possible null value to non-nullable type.
[/workspaces/pulumi/sdk/dotnet/Pulumi.Automation/Pulumi.Automation.csproj]
```

Quick fix to just not use "var" here.
This commit is contained in:
Fraser Waters 2021-10-29 16:29:45 +01:00 committed by GitHub
parent e38876f7af
commit e71fd81fe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -384,7 +384,7 @@ namespace Pulumi.Automation
internal static SemVersion? ParseAndValidatePulumiVersion(SemVersion minVersion, string currentVersion, bool optOut)
{
if (!SemVersion.TryParse(currentVersion, out var version))
if (!SemVersion.TryParse(currentVersion, out SemVersion? version))
{
version = null;
}