Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Function: use
originalname
in_getobj
and make it default toname
#7035Function: use
originalname
in_getobj
and make it default toname
#7035Changes from 1 commit
d4b5990
c145437
3e44a10
faa50ca
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Given a field called "originalname", I'd expect it to only contain the original name, but this adds a fallback to
name
, which is presumably not the original name? If so, then this seems unadvisable. Maybe do thisif
in_getobj
instead?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.
Ideally this would be a alias for functiondefinition.name
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.
@bluetech the point is that it should be usable as-is, i.e. also for non-parametrized functions (where
name
is the original name AFAICT).Check 1a79137: it only passes it in for parametrized functions.
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.
(Replying only to the diff, not Ronny's comment which I didn't look into)
Would it be possible to fix that? I.e. make
originalname
be passed always, even when it's the same asname
? That would address my concern and makes some sense anyway I think...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.
Done it. 👍
I tried @RonnyPfannschmidt's suggestion, which I think is more elegant, but the problem is that
_getobj
usesoriginalname
to obtain the function, andoriginalname
requires the function, so we get a recursion.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.
Nitpick: I think this description is too low-level, I would go for something more like "Check that functions with square brackets don't cause trouble".
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's in the test name already.
I've added the extra doc to explicitly state what it is testing internally.
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 would leave it out then -- it might just become outdated if the mechanism changes, but the test itself will stay relevant always because it tests high-level behavior.
Feel free to disregard though if you prefer to keep it :)