Skip to content

Enable Nullable ref types#1437

Merged
SimonCropp merged 44 commits intomainfrom
nullable
Feb 23, 2024
Merged

Enable Nullable ref types#1437
SimonCropp merged 44 commits intomainfrom
nullable

Conversation

@SimonCropp
Copy link
Collaborator

No description provided.

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

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
@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