Expand the [NotNull...] attributes to cover collections #7829
Unanswered
SRNissen
asked this question in
Language Ideas
Replies: 1 comment 9 replies
-
Unfortunately, this is probably almost impossible. How does C# know that you checked all the elements? It now has to interpret a loop's conditions - like |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Consider a method
static boool AnyNull(...)
used like:Here, if
AnyNull
has overloads for 1 through X parameters, each parameter can be annotated with[NotNullAttribute]
.But if
AnyNull
is written like(params object?[] objects)
there is no way to indicate that each object has been checked for null.I would like to be able to do that.
Beta Was this translation helpful? Give feedback.
All reactions