-
Notifications
You must be signed in to change notification settings - Fork 125
Extract modelType out of ModelElement #2583
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
…odelType-refactor
…odelType-refactor
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.
LGTM. Very nice refactor and simplification
lib/src/model/accessor.dart
Outdated
if (_modelType == null) { | ||
if (originalMember != null) { | ||
_modelType = | ||
ElementType.from(originalMember.type, library, packageGraph); |
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.
Would originalMember ?? element
work here?
_modelType =
ElementType.from((originalMember ?? element).type, library, packageGraph);
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.
yes, this can all be collapsed. Done here and elsewhere
This breaks up one big chunk of those if type/do this bits in ModelElement that need to be eliminated. In this case, it makes generic type aliases easier to implement and think about with this done.