Skip to content
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

⬆ Enable C#8 language features and nullability warnings #185

Merged
merged 6 commits into from
Jun 1, 2020
Merged

Conversation

tomrijnbeek
Copy link
Member

@tomrijnbeek tomrijnbeek commented Jun 1, 2020

✨ 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 used IEnumerable<object[]> for parameterised tests, but nullability doesn't like that. There is actually a typesafe way of passing in data using TheoryData, 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.

@tomrijnbeek tomrijnbeek merged commit f794b14 into master Jun 1, 2020
@tomrijnbeek tomrijnbeek deleted the cs8 branch June 1, 2020 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants