Change definition to class Optional<T extends Object>#736
Change definition to class Optional<T extends Object>#736oprypin wants to merge 1 commit intogoogle:masterfrom
class Optional<T extends Object>#736Conversation
This excludes nullable types from being able to be put into an Optional, which is confusing.
|
See for the last time we did this: #667. If we've already done this internally though, that's great news and eliminates the main reason we backed this change out. It may be useful to conduct a quick use of open source projects to see what impact we can expect to users. Overall though, lgtm in principle from me. |
It is a breaking change but as I said I already applied this change there. So if Google codebase was a big part of the reason, it no longer applies. |
|
Apologies -- submitted the comment accidentally while I was still writing it. It's updated now. |
Hm I haven't done such a survey before. Maybe if someone already has a setup for something like this, they could chip in. |
|
@yjbanov I think you've got experience doing this previously using BigQuery? If not, it's something the Flutter framework team has a lot of experience with. Will see if I can dig up a doc. |
This prevents
Optionalfrom being declared with a nullable type. It is never useful to do so, because trying to create an instance with anullcauses a run-time error anyway. So just confusing.Internally we already applied this change and were quite easily able to clean up any existing occurrences.