|
|
|
|
|
by dtech
1488 days ago
|
|
If this question is in good faith, for example Kotlin differentiates between the nullable T? and the non-nullable T. An if x != null check automatically casts T? to T. You can't call a method on T?, preventing null pointer exceptions. C# and Typescript have similar language support. Other languages push users away from the problem by favoring monadic Optional/Maybe solutions. |
|
(But thanks, I overlooked T? conversions inside if.)