Skip to content

Nullable Reference Types#642

Open
TheConstructor wants to merge 1 commit into
Handlebars-Net:masterfrom
TheConstructor:feature/nullable-references
Open

Nullable Reference Types#642
TheConstructor wants to merge 1 commit into
Handlebars-Net:masterfrom
TheConstructor:feature/nullable-references

Conversation

@TheConstructor

Copy link
Copy Markdown
Contributor

I tried my best to annotate everything with Nullable Reference Annotations, and to convince the compiler of them (i.e. move assignments to the expected positions, ...). It's definitely a big PR. Sorry.

@rexm

rexm commented Jun 23, 2026

Copy link
Copy Markdown
Member

What is the purpose?

@TheConstructor

TheConstructor commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

What is the purpose?

It may make it more obvious to the user of the library when Handlebars.Net expect something not to be null on one hand, and it will make the compiler push you to make null-checks at the right times - at least in theory. There are some situations, were the tooling isn't advanced enough to understand when something can or can't be null. Still it usually leads to fewer unthought of NullReferenceExceptions.

If you are new to NRT you might read https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis - it contains some use-cases and how describes how the tooling tries to help you

@TheConstructor TheConstructor force-pushed the feature/nullable-references branch from 0acc55b to 2a6fdd7 Compare June 24, 2026 21:17
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