Great read. C# has the concept of nullable reference types[1] which requires you to be explicit if a variable can be null and the compiler is aware of this. I would love to see a similar feature in languages like TypeScript and Go.
[1]: https://learn.microsoft.com/en-us/dotnet/csharp/nullable-ref...
TypeScript has disctinct nullable and non-null types if you enable `strictNullChecks` or `strict` in TSConfig (https://www.typescriptlang.org/tsconfig/#strictNullChecks).
In fact, part of the implementation (or at least ideas) were borrowed from TypeScript. Nullability in C# changes depending on the checks around the code (similar to how the type of expressions in ThpeScript can change depending on prior code).
Oh wow, I didn't know this was a thing. I knew about nullable value types, and have started to use them a bit, but this looks like it could be very useful