Version Used:
VisualStudio.16.Release/16.11.0+31605.320
C# Tools 3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10
Steps to Reproduce:
#nullable enable
using System;
public class TestClass
{
public TestClass(object? value) { }
public TestClass(Func<object?> value) { }
// IDE0004: Cast is redundant.
public TestClass Create1() => new ((object?)null);
// CS8625: Cannot convert null literal to non-nullable reference type
public TestClass Create2() => new (null);
}
Expected Behavior:
Wether Create1 or Create2 shouldn't generate any messages.
Actual Behavior:
Both variants generate error or IDE warning
Version Used:
VisualStudio.16.Release/16.11.0+31605.320
C# Tools 3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10
Steps to Reproduce:
Expected Behavior:
Wether Create1 or Create2 shouldn't generate any messages.
Actual Behavior:
Both variants generate error or IDE warning