Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullability warnings are not reported inside collection expressions #69979

Closed
thinker227 opened this issue Sep 16, 2023 · 3 comments
Closed

Nullability warnings are not reported inside collection expressions #69979

thinker227 opened this issue Sep 16, 2023 · 3 comments
Labels
Area-Compilers New Feature - Collection Expressions Resolution-Duplicate The described behavior is tracked in another issue untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@thinker227
Copy link

thinker227 commented Sep 16, 2023

Version Used: 4.8.0-1.23374.10 (520e2f1)

Steps to Reproduce:

  1. Assign a collection expression containing a null literal (or some other value which may be null) to a collection type which element type is not nullable.
IEnumerable<string> xs = ["a", null, "b"];

Sharplab link

Expected Behavior: CS8625 (or another applicable nullability warning) is reported on null.

Relates to #66418

Actual Behavior: No nullability warnings are reported.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 16, 2023
@thinker227
Copy link
Author

Was informed this is already being worked on.

@CyrusNajmabadi
Copy link
Member

Reactivating while the issue still repros

@jcouv
Copy link
Member

jcouv commented Sep 25, 2023

Closing as duplicate of #68786

@jcouv jcouv closed this as not planned Won't fix, can't repro, duplicate, stale Sep 25, 2023
@jcouv jcouv added the Resolution-Duplicate The described behavior is tracked in another issue label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers New Feature - Collection Expressions Resolution-Duplicate The described behavior is tracked in another issue untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

3 participants