-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Consider adding MaybeDefault to Microsoft.CodeAnalysis.NullableFlowState #39981
Comments
This would be a huge help for Related to dotnet/csharplang#146 |
@sharwell I don't think this helps at all for |
In that case, how would MaybeDefault help? MaybeNull already has the same meaning in that case. |
It does not. This is how we've solved the [MaybeNull] on unconstrained type parameters, it's very possible some IDE features will want to see this info as well. |
I've said before, it might be the most practical to let that be a documented caveat when the default-ness is a private implementation detail. It's primarily the places where the default-ness can escape over an API boundary where the flow analysis should inform the consuming code. |
Closing as this would represent a breaking change at this point, particularly since we added the defaultable generic support to nullability. Can re-open and re-visit a different style of API if we get enough requests for it. |
Consider adding
MaybeDefault
toMicrosoft.CodeAnalysis.NullableFlowState
to allow analyzers to differentiate values that may benull
even if the type may be not nullable.For instance, to represent the flow state of
item
:See dotnet/csharplang#2946
See #39778
[jcouv: even if we don't make this change, we should document the maybe-default state in Mads' spec]
The text was updated successfully, but these errors were encountered: