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 Nullable ref types #1437

Merged
merged 44 commits into from
Feb 23, 2024
Merged

Enable Nullable ref types #1437

merged 44 commits into from
Feb 23, 2024

Conversation

SimonCropp
Copy link
Collaborator

No description provided.

@SimonCropp SimonCropp requested a review from hazzik February 22, 2024 13:03
@hazzik
Copy link
Member

hazzik commented Feb 22, 2024

I think you need to approve the API difference.

I'm just wondering how did you determine where the types be nullable and where not?

@SimonCropp
Copy link
Collaborator Author

fixed the api

I'm just wondering how did you determine where the types be nullable and where not?

There are a few techniques

  • good tests can inform it. since where nulls are passed those parameters must be nullable. where argumentnull exceptions are asserted those parameters are not null
  • Optional parameters (where parameter =null) help a lot
  • any method that returns a null. then the return value is nullable
  • an understanding of the expectations public api can inform u where return values should not be null

Then usually that is enough for the compiler to help you flow those nullables through the rest of the code

@SimonCropp SimonCropp merged commit 081f524 into main Feb 23, 2024
3 checks passed
@SimonCropp SimonCropp deleted the nullable branch February 23, 2024 00:03
@SimonCropp SimonCropp added this to the v3.0 milestone Feb 23, 2024
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