-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Allow OverloadedFuncDef to have no items #6174
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
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.
Thanks for the PR! I have one suggestion.
self.items = items | ||
self.unanalyzed_items = items.copy() | ||
self.impl = None | ||
self.set_line(items[0].line) | ||
if len(items) > 0: | ||
self.set_line(items[0].line) |
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.
Maybe try using self.impl
to set line, like in the name()
method just below?
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.
That does not work, as self.impl
is None
at this point (see line above).
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.
OK, I see, maybe then set line in deserialize()
method below? For example under the if data.get('impl') is not None:
branch if items
is empty (with a comment explaining that if overload items are empty then the line will not be set in __init__
).
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.
Good idea, I added it, works for me locally 👍
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.
Thanks, LGTM now!
Tested this locally, works for me, but I'm not sure if this assertion is necessary for something else.
Fixes #6108