This repository was archived by the owner on Nov 12, 2026. It is now read-only.
Repository navigation
Handle null initializer for array creation operation - #6696
Merged
Merged
Conversation
Author
mavasani
commented
Jun 19, 2023
| } | ||
|
|
||
| [Fact, WorkItem(6686, "https://github.com/dotnet/roslyn-analyzers/issues/6686")] | ||
| public Task ArrayWithoutInitializer_Diagnostic() |
Author
There was a problem hiding this comment.
Verified AD0001 from this test prior to the fix
mavasani
commented
Jun 19, 2023
|
|
||
| // Must be literal array | ||
| if (arrayCreationOperation.Initializer.ElementValues.Any(x => x is not ILiteralOperation)) | ||
| if (arrayCreationOperation.Initializer != null && |
Author
There was a problem hiding this comment.
FYI: I am working on moving the Microsoft.CodeAnalysis package reference for NetAnalyzers project from 3.3.1 to 3.11, which should bring in the nullable annotated IOperation API surface and hence prevent such NREs in future.
Youssef1313
reviewed
Jun 19, 2023
Youssef1313
reviewed
Jun 19, 2023
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6696 +/- ##
=======================================
Coverage 96.39% 96.39%
=======================================
Files 1379 1379
Lines 322416 322439 +23
Branches 10461 10461
=======================================
+ Hits 310782 310811 +29
+ Misses 9140 9135 -5
+ Partials 2494 2493 -1 |
…dConstArrays.cs Co-authored-by: Youssef Victor <youssefvictor00@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6686