https://pulumi.com logo
#dotnet
Title
t

tall-needle-56640

02/04/2021, 11:44 PM
Any idea what is going on here? Why is the reference after the
Output.Create
possibly null?
Copy code
private void DoSomething(ResourceGroup resourceGroup)
{
    var test = resourceGroup.Name;  // No null warning
    var output = Output.Create(resourceGroup);
    var test2 = resourceGroup.Name; // Possible null reference warning
}
t

tall-librarian-49374

02/05/2021, 7:26 AM
t

tall-needle-56640

02/05/2021, 3:45 PM
Hmmm... Why are we attributing it with
MaybeNull
? I'm reading this as "even though I'm passing in a non-null value, a null value may be returned". Why isn't this sufficient?
Copy code
public static Output<T> Create<T>(T value) => Create(Task.FromResult(value));