Get the latest tech news
Nullable vs. Nullable in C#
August 25, 2025 One of the most unfortunate parts of the nullability narrative in C# is the reuse of the T? syntax to denote two completely separate concepts for value types and reference types. This leads to some odd and confusing behaviour.
In case that’s not entirely clear, my first naive attempt at writing such a method in C# should make it clearer. First, it worked for strings, and second, the whole point of the method is that the return type sheds the possibility of null! Luckily, since type constraints are part of the signature of the method and there is no ambiguity, I am allowed to make this overload.
Or read this on Hacker News