Skip to content

Fix analyzer RCS1246 for conditional access expressions - #1772

Merged
josefpihrt merged 7 commits into
dotnet:mainfrom
krajek:fix/expression-analyzer-for-nullable-ireadonlylist
Aug 8, 2026
Merged

Fix analyzer RCS1246 for conditional access expressions#1772
josefpihrt merged 7 commits into
dotnet:mainfrom
krajek:fix/expression-analyzer-for-nullable-ireadonlylist

Conversation

@krajek

@krajek krajek commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Smallest reproducible program I could come up with:

new { Values = new int[0] }?.Values.ElementAt(0);

Without the fix, the analyzer in that case throws NRE and fails the build.

@krajek

krajek commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@krajek

krajek commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Hi, is there anything I could do to move this forward?

Comment thread ChangeLog.md Outdated
Comment thread src/Common/CSharp/Analysis/UseElementAccessAnalysis.cs Outdated
@josefpihrt

Copy link
Copy Markdown
Collaborator

@krajek Hey, thank you for your contribution and sorry for late review.

@josefpihrt
josefpihrt merged commit ba8de95 into dotnet:main Aug 8, 2026
17 checks passed
This was referenced Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants