⬆ Enable C#8 language features and nullability warnings #185
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.
✨ What's this?
This PR switches the language support for all projects to C# 8. It also enables warnings for nullable reference types. It does not enforce them yet, as several classes need cleanup beyond the scope of a single PR.
🔗 Relationships
See #184 for follow-up task of moving to full nullability enforcement.
🔍 Why do we want this?
C# 8 leads to nicer, more readable code. Nullable reference type enforcement discourages the use of null, which in turn improves code stability.
🏗 How is it done?
The project files are updated. The other changes were either simple search and replaces, or were done with IDE support.
The big manual change was the
DeletableObjectListTests
file. It usedIEnumerable<object[]>
for parameterised tests, but nullability doesn't like that. There is actually a typesafe way of passing in data usingTheoryData
, so I just switched to that instead.💥 Breaking changes
None.
🔬 Why not another way?
N/A
🦋 Side effects
We may see our return types in the future be moved from non-nullable to nullable. However, we're not in a worse state now than we were before.
💡 Review hints
Each of the commits is a simple change (by design), or a search and replace, so reviewing commit by commit may be easier than reviewing all changes together.