-
Notifications
You must be signed in to change notification settings - Fork 166
nnbd tidying #2458
Conversation
|
Something that is not super consistent with these changes and elsewhere in null safety migrations is the difference between code similar(but not limited) to the following: var person = group.leader;
return person != null && person.isCool;versus var person = group.leader;
return person?.isCool == true;I'm not sure which I prefer, but I wonder if there should be a suggestion as part of |
bwilkerson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of my comments are required, so take them or leave them.
|
@parlough: thanks for noticing this. I almost wrote a note about it. I admit I feel pretty uneasy about code like |
The recommendation from Effective dart is:
Do we have a lint for that? |
|
@a14n: I had missed that entirely. I appreciate the rationale too. We should absolutely lint for it though IMO. |
More tidying up.
On balance I think this makes the codebase a lot better and surely more safe. There were a number of places where I was tempted to do deeper structural re-organization but I opted not to in the interest of keeping this more manageable. At some point I do think a full audit would be in order.
There are a few test utilities left after this but this should get
libunder control.Thanks in advance for muddling through!
/cc @bwilkerson