Nullability in C#
summary
C# 9 extends nullable reference types from C# 8 with concrete language and library work so null tracking is usable today across large codebases and libraries. It adds #nullable enable for incremental adoption, flow analysis into constructors and captured locals, generics support with T?, attributes like MemberNotNull and DoesNotReturnIf with compiler enforcement, the null‑forgiveness operator to override warnings, and .NET 5 annotations covering ~98% of core APIs so the feature finds real bugs and ships successfully.
AI-written summary · about
chapters (27)
- 0:00Introduction
- 2:46Talk overview
- 3:48Design philosophy
- 6:01Discarded solutions
- 8:35Incremental adoption
- 12:04Key principles
- 13:22Feature demo
- 16:17Annotation interaction
- 17:36Null forgiveness
- 18:15Generics
- 19:12Mixed codebases
- 20:17Flow analysis
- 22:53Advanced flow analysis
- 25:47Helper attributes
- 29:27C# 9 improvements
- 31:28Initialization patterns
- 33:59Attribute enforcement
- 36:44Generics in C# 9
- 39:35Library compatibility
- 42:21Constructor flow analysis
- 46:26Local functions
- 48:33Captured value analysis
- 50:36Framework annotations
- 53:17Adoption strategies
- 55:26Annotation order
- 58:36Future work
- 1:02:58Q&A
