-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Hint to me when I have nullable fields in an object #57173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm curious what the story for suppressing lint warnings is going to be. This seems like a rule that's likely to give large numbers of warnings for things that are valid. For example, if I have Thing with no empty() constructor I might very well end up with a ThingBuilder which would have those warnings. Am I going to be able to indicate that particular uses are fine, or am I going to have to turn the rule off globally or else learn to ignore those warnings? |
Good question! I don't know how one opts-into lints, especially ones that could have performance ramifications. Maybe the user makes an explicit request: "Show me lints that make the VM and dart2js happy" |
Great question @alan-knight. There's the beginning of a conversation started over on #57153 but nothing is settled. Feel free to chime in! @sethladd : wanna take a stab at a short description? For more context, I threw together some basic lint writing guidelines here. (Thanks for the nudge! 👍 ) |
Superseded by null safety. |
The following construct should be avoided:
Issues are:
empty()
.The VM has a hard time optimizing fields that could be double or null. dart2js has a hard time optimizing field access that could be null.
Of course, I could set x,y,z to final. Or, I could eliminate empty() constructor.
The text was updated successfully, but these errors were encountered: