Version Used:
4.1.0-5.22109.6 (0c82c41)
Steps to Reproduce:
The following minimal code demonstrates the problem:
record Foo(IEnumerable<char> Bar = "x");
var f = new Foo();
Assert.IsNotNull(f.Bar);
Same happens in any method with default argument of interface type that System.String implements.
The usage of System.Object as argument type fails, though.
Expected Behavior:
Either method argument set to the given non-null constant value, or compiler error is raised (like for System.Object case right now).
Actual Behavior:
Method argument silently set to null.
Version Used:
4.1.0-5.22109.6 (0c82c41)
Steps to Reproduce:
The following minimal code demonstrates the problem:
Same happens in any method with default argument of interface type that
System.Stringimplements.The usage of
System.Objectas argument type fails, though.Expected Behavior:
Either method argument set to the given non-null constant value, or compiler error is raised (like for
System.Objectcase right now).Actual Behavior:
Method argument silently set to
null.