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

Enabled nullable annotations. #953

Merged
merged 2 commits into from
Jul 21, 2023
Merged

Conversation

MoFtZ
Copy link
Collaborator

@MoFtZ MoFtZ commented Mar 1, 2023

Enabled C# nullable reference types, and updated the codebase with annotations.

Added AsNotNull method to apply the null-forgiving ! operator. This makes it easier to find the usages, and will allow us to later apply global changes like assertions.

Added ThrowIfNull method to throw an exception when the call should never fail.

Added InitNotNullable method for cases when the type should not be nullable, but we need to set it to null anyway. This normally occurs in the constructor, where we known it will be initialized before use.

@MoFtZ MoFtZ force-pushed the feature/nullable branch 2 times, most recently from ede4e6d to 5b7a68c Compare March 3, 2023 08:28
@MoFtZ
Copy link
Collaborator Author

MoFtZ commented Mar 3, 2023

Resolved merge conflicts.

@MoFtZ MoFtZ force-pushed the feature/nullable branch 3 times, most recently from ba2164f to d6db1f8 Compare June 22, 2023 22:49
Src/ILGPU/Util/NullableAttributes.cs Show resolved Hide resolved
Src/ILGPU/Runtime/CPU/CPUStream.cs Show resolved Hide resolved
@m4rs-mt m4rs-mt added this to the v1.5 milestone Jul 20, 2023
@m4rs-mt m4rs-mt merged commit 42b4935 into m4rs-mt:master Jul 21, 2023
@MoFtZ MoFtZ deleted the feature/nullable branch July 21, 2023 21:20
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