2 ms·
Which can still lead to unrecoverable runtime errors, that could otherwise be compilation errors.
by disintegore 4y ago
Which can still lead to unrecoverable runtime errors, that could otherwise be compilation errors.
- masklinn 4y agoWhat are you talking about?
- disintegore 4y agoI'm talking about the fact that nullable types do not on their own guarantee null safety and that these two things are not equivalent.
- masklinn 4y agoThat's about as unclear as your previous comment, at best. At worst, it's just wrong. The typechecker would only allow on the union operations which are allowed on both types, anything beyond that would first have to use type checks or assertions in order to split the union. So, again, what are you talking about?
- disintegore 4y agoThat's actually a good point. I made assumptions about the meaning of the term `null` that can't be true in every language that uses it. There are some exceptions to the behaviour you describe, like for instance with C# which for the longest time only allowed value types to be annotated as nullable, and only very recently extended this to reference types, and only as an opt-in feature, and the type checker only throws warnings, etc. That would be a case of a language which is not "null safe" but provides faculties for accomplishing that.