Changes
-
Nullable Reference Types @TheConstructor (#642)
The entire public API surface is now annotated for Nullable Reference Types.
Compatibility notes:
- Binary- and runtime-compatible. Nullability annotations are compile-time metadata only; generated IL is unchanged. Projects without
<Nullable>enable</Nullable>are unaffected. - Nullable-enabled consumers get compiler-checked null contracts on the public API:
Try*methods are annotated with[MaybeNullWhen(false)], optional parameters and nullable returns are declared with?, etc. - If you implement extensibility interfaces, their signatures gained nullability annotations and your existing implementations may produce nullability-mismatch warnings (e.g. CS8767) until you add the matching
?annotations. Affected:IPartialTemplateResolver,ITextEncoder,IMemberAccessor,IHelperResolver,IFormatterProvider,IObjectDescriptorProvider,IHelperDescriptor<T>, and theViewEngineFileSystembase class. HandlebarsConfiguration.FileSystemis now declared nullable (ViewEngineFileSystem?), matching its actual default.- The built-in collection formatters now throw
ArgumentNullExceptionwith a parameter name instead of a rawNullReferenceExceptionwhen given a null or mismatched value.
- Binary- and runtime-compatible. Nullability annotations are compile-time metadata only; generated IL is unchanged. Projects without
Contributors
Full Changelog: 2.2.0...2.3.0