D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13298 - __traits(calledFunctions, f)
Summary: __traits(calledFunctions, f)
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-15 19:05 UTC by bearophile_hugs
Modified: 2024-12-13 18:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2014-08-15 19:05:42 UTC
I suggest to add a trait that returns a tuple of all the functions called by a given function, including run-time functions.


void foo() {}
void bar() {}
void spam() { foo(); bar(); }

is(__traits(calledFunctions, spam) == TypeTuple!(foo, bar))

This is useful to implement in user code transitive function properties tagged with UDAs.

Optionally this trait too can be handy:

__traits(isRuntimeFunction, f)
Comment 1 dlangBugzillaToGithub 2024-12-13 18:24:02 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17676

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB