3 ms·
The problem with that approach is that if you have it there, people will forget to use it, and still end up with tons of nullable references that really should
by int_19h 9y ago
The problem with that approach is that if you have it there, people will forget to use it, and still end up with tons of nullable references that really should be non-nullable. In order to be effective at catching bugs, non-nullability has to be opt-out rather than opt-in.
Yes, this sucks for existing code. I suspect that we'll get some kind of file-level switch, so that you can port things one class at a time - there's no reason why that switch has to have the same value for all files in the project.
- SimonPStevens 9y agoNo reason why there can't be both. Syntax to opt in one at a time for old projects, and a compiler option for new projects. Yeah, or a file level switch would do, that would be fine. As long as there is some way of transitioning a project little bit at a time. I hope we get one of those options