Skip to content

Enable nullable references in Moq.csproj #1535

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

Open
wants to merge 92 commits into
base: main
Choose a base branch
from

Conversation

andrewimcclement
Copy link

@andrewimcclement andrewimcclement commented Feb 26, 2025

Aims to resolve #1418 , #1416 .

Does not extend to Moq.Tests.csproj, etc.

Nullable reference issues are enabled as warnings in Moq.csproj. Several issues have been left unresolved, as I lack the knowledge to resolve them correctly at this time (perhaps maintainers can help here, or else it may be acceptable to put this PR down as is and slowly pick off the remaining nullable reference warnings one at a time).

In general I have tried hard to avoid actually changing the code functionality, except where it seemed clear. So several simplifications could be made in follow up PRs.

See the docs for details of the nullability attributes I have used.

@CLAassistant
Copy link

CLAassistant commented Feb 26, 2025

CLA assistant check
All committers have signed the CLA.

@kzu kzu force-pushed the aim/nullable-enable branch from edc86ce to 0b65989 Compare May 26, 2025 11:51
@kzu
Copy link
Member

kzu commented May 26, 2025

To fix the dotnet-format build error, plz run:

dotnet format whitespace -v:diag --exclude ~/.nuget; dotnet format style -v:diag --exclude ~/.nuget

@kzu kzu force-pushed the aim/nullable-enable branch from 0b65989 to fc1261d Compare May 26, 2025 19:00
@kzu kzu added the tech debt label May 26, 2025
…hing ever calls `new Condition(null)` so we can simply rely on nullable annotations, so long as we guard the public interface.
@kzu kzu force-pushed the aim/nullable-enable branch from fc1261d to c1d2a24 Compare May 26, 2025 19:16
@andrewimcclement
Copy link
Author

Run the dotnet format command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The public API is still missing nullable reference type annotations
3 participants