-
Notifications
You must be signed in to change notification settings - Fork 231
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
SE: Learn ObjectConstraint for nullable types #6812
Closed
14 tasks done
Labels
Milestone
Comments
Having just
We need to look into explicit and implicit conversions between nullable and non-nullable. |
Testing
|
This was referenced Mar 2, 2023
This was referenced Mar 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add
Null
constraint to the Roslyn SE for nullable value types..Value
memberBoolConstraint
on.HasValue
from knownObjectConstraint
, and do not learnNotNull
from property referenceNull
constraint fornew Nullable<int>()
new Nullable<int>(value)
ornew Nullable<int>(42)
ObjectConstraint
when branching on.HasValue
ObjectConstraint
when branching on null checksObjectConstraint
when branching on==value
checks.GetValueOrDefault()
- do not lean "NotNull" on the invocation, propagate constraintObjectConstraint
when onDebug.Assert
testsb = x.HasValue & x.Value;
.Equals(42)
and.Equals(null)
,object.Equals(left, right)
#6840 deals with S2259 overlap
This issue requires more investigation to implement properly.The text was updated successfully, but these errors were encountered: