-
Notifications
You must be signed in to change notification settings - Fork 412
Support inherited fields #107
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
Conversation
34fdbbd
to
49cf50c
Compare
49cf50c
to
20ea00b
Compare
|
||
/// Returns a list of all instance, [FieldElement] items for [element] and | ||
/// super classes. | ||
List<FieldElement> _getFields(ClassElement element) { |
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.
[optional] I have a personal vendetta against methods named get*
. Maybe findFields
or allFields
?
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.
Changed to _listFields
var manager = new InheritanceManager(element.library); | ||
var things = manager.getMembersInheritedFromClasses(element); | ||
|
||
things.forEach((k, v) { |
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.
you don't appear to use k
at all and this loop has side effects. a for-in loop would be more idiomatic
for(final member in things.values) {
assert(!member.isStatic)
...
}
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.
ack
var fieldsList = element.fields.where((e) => !e.isStatic).toList(); | ||
|
||
var manager = new InheritanceManager(element.library); | ||
var things = manager.getMembersInheritedFromClasses(element); |
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.
things is not descriptive. inheritedMembers
maybe, or skip the variable since it's not used more than once.
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.
ack
var things = manager.getMembersInheritedFromClasses(element); | ||
|
||
things.forEach((k, v) { | ||
assert(!v.isStatic); |
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.
are we asserting behavior of getMembersInheritedFromClasses
? Do we need to?
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.
ack
No description provided.