-
Notifications
You must be signed in to change notification settings - Fork 117
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
Remove all dynamic calls and properly enforce lint rule #2582
Conversation
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.
Nicely done. Just one little optional nit.
for (var item in yamlData) { | ||
returnData.add(item.toString()); | ||
} | ||
returnData = [ |
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.
I think this is fine, though it seems odd to me to omit <String>
?
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.
String
is inferred from the elements as the type of the list. This is listed in Effective Dart:
@@ -1097,7 +1097,7 @@ abstract class ModelElement extends Canonicalization | |||
} | |||
if (params == null && element is FunctionTypedElement) { | |||
if (_originalMember != null) { | |||
params = (_originalMember as dynamic).parameters; |
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.
this is a good one to get rid of. That might cover up some nasty bugs otherwise. Don't remember why that is there...
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.
Haha it was a little weird.
String name = decodedJson['name']; | ||
var versions = List<Version>.from( | ||
decodedJson['versions'].map((v) => Version.parse(v))); | ||
var versions = [ |
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.
Assuming inference works properly for the list type here?
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.
Right, Version.parse
returns a Version, and this is the only element (repeated) in the list, so inference will find Version.
No description provided.