Skip to content

deduplicate the 'isSomeFunction' equivalent#7749

Merged
dlang-bot merged 1 commit intodlang:masterfrom
UplinkCoder:function_traits
Jan 19, 2018
Merged

deduplicate the 'isSomeFunction' equivalent#7749
dlang-bot merged 1 commit intodlang:masterfrom
UplinkCoder:function_traits

Conversation

@UplinkCoder
Copy link
Member

as per title

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @UplinkCoder!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@JinShil
Copy link
Contributor

JinShil commented Jan 18, 2018

FYI: This is a resubmission of #6835 because the Phantom Zone thing didn't work out well. We couldn't re-open the PR after @UplinkCoder made changes.

a delegate, function, function-pointer
or a variable of the former. Otherwise, `null`.
*/
static TypeFunction toTypeFunction(RootObject o, FuncDeclaration* fdp = null)
Copy link
Contributor

@JinShil JinShil Jan 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Continuing our discussion from Slack: I completely overlooked that this was a nested function. In that case, yes, please disregard my previous comments (Sorry!). But none of the other nested functions here are static. I suggest removing static.

Otherwise, what I was implying with my previous comments is that this is a utility function, and might be better as a private free function of the module. I'm not going to require it though. your call.

UPDATE: In summary, either remove the static (or justify it), or make the function a private free function in the module. I leave it up to you to decide.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPDATE 2: OK, I just realized the outer function context is not required, so static seems to make sense. I'm good, now. Sorry to beat this horse so much.

@JinShil JinShil added the Severity:Refactoring No semantic changes to code label Jan 18, 2018
Copy link
Contributor

@JinShil JinShil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to leave a short window of opportunity for others to add their review before I merge.

@WalterBright
Copy link
Member

My review is here #7754 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merge:auto-merge Severity:Refactoring No semantic changes to code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants