-
Notifications
You must be signed in to change notification settings - Fork 267
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
Add .NET 5 target and arrange nullability attributes #636
Conversation
dd08d72
to
624ccce
Compare
- Update .NET SDK on CI - Update Ruby on CI - Embed icon to the NuGet package - Trim trailing whitespace
624ccce
to
6e91b62
Compare
6e91b62
to
c4e9e8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @zvirja , thanks!
I've left comments but approving as they are all due to me not being familiar with non-nullable ref types yet 😂
c4e9e8e
to
5cd76ab
Compare
5cd76ab
to
4c488c3
Compare
@dtchepak I updated a bit of code after I found out that we could use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thanks answering my questions 😄
Releasing changes from nsubstitute#636 and nsubstitute#674.
Decided to play a bit with nullability and enhance this project in the same time 😊 Enabled nullability checks for NET 5. As a side effect also added .NET 5 framework target.
Code was adjusted to ensure it's null-valid. I did not find any subtle bug though. Some details of the implementation:
member.DeclaringType
was mostly null-suppressed, as I do not expect nulls there.obj.ToString()
type annotation allows null (against common sense IMO 😖), so I coerce value to an empty string just in case.I also plan to also make a subsequent PR and use the latest C# features in our code files. Also want to remove null checks in the code where we enabled nullability. If you have strong opinion against that please speak 😄
P.S. Also had to maintain the project (update SDK and Ruby on CI) to make sure I can build the project.