Open TessenR opened 5 months ago
@cston believed this is fixed now. Can we close?
This is still an issue. The compiler is not checking the nullability for elements of collection expressions for target types that implement IEnumerable
and do not use [CollectionBuilder]
(see sharplab.io).
Version Used:
Steps to Reproduce:
Compile and run the following code:
sharplab.io
Expected Behavior: There should be a warning about mismatching nullability somewhere on the line
List<string> list = [null];
Actual Behavior: No warnings at all. The program crashes at runtime with a
NullReferenceException