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

Turn on Nullable #88

Open
petrsvihlik opened this issue Oct 25, 2019 · 2 comments
Open

Turn on Nullable #88

petrsvihlik opened this issue Oct 25, 2019 · 2 comments
Labels
hacktoberfest https://hacktoberfest.digitalocean.com/ help wanted refactoring up-for-grabs

Comments

@petrsvihlik
Copy link
Owner

petrsvihlik commented Oct 25, 2019

https://docs.microsoft.com/en-us/dotnet/csharp/nullable-references#nullable-contexts

Make code safer by turning on <Nullable>enable</Nullable> in .csproj and solving the warnings.

use if (obj is null) and if (obj is { }) for null checks
https://youtu.be/TJiLhRPgyq4?list=PLReL099Y5nRd04p81Q7p5TtyjCrj9tz1t&t=683

@petrsvihlik petrsvihlik added help wanted hacktoberfest https://hacktoberfest.digitalocean.com/ refactoring up-for-grabs labels Oct 25, 2019
@petrsvihlik
Copy link
Owner Author

switch to the latest version of c# via directory.props (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version#configure-multiple-projects)

and unify all null checks (== null, != null, is null, is { }) to is null and is not null (logical patterns)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest https://hacktoberfest.digitalocean.com/ help wanted refactoring up-for-grabs
Projects
None yet
Development

No branches or pull requests

1 participant