Add .NET 5 target and arrange nullability attributes#636
Merged
zvirja merged 3 commits intonsubstitute:masterfrom Dec 10, 2020
Merged
Add .NET 5 target and arrange nullability attributes#636zvirja merged 3 commits intonsubstitute:masterfrom
zvirja merged 3 commits intonsubstitute:masterfrom
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
c4e9e8e to
5cd76ab
Compare
5cd76ab to
4c488c3
Compare
Contributor
Author
|
@dtchepak I updated a bit of code after I found out that we could use |
dtchepak
approved these changes
Dec 10, 2020
Member
dtchepak
left a comment
There was a problem hiding this comment.
LGTM 👍
Thanks answering my questions 😄
dtchepak
added a commit
to dtchepak/NSubstitute
that referenced
this pull request
Jan 17, 2022
Releasing changes from nsubstitute#636 and nsubstitute#674.
Merged
dtchepak
added a commit
that referenced
this pull request
Jan 24, 2022
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.DeclaringTypewas 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.