D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 18972 - __traits(getOverloads) example with 3rd argument doesn't compile
Summary: __traits(getOverloads) example with 3rd argument doesn't compile
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-11 21:19 UTC by Dennis
Modified: 2020-03-21 03:56 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 Dennis 2018-06-11 21:19:15 UTC
https://dlang.org/spec/traits.html#getOverloads
"The third argument is a bool, and is optional. If true, the result will also include template overloads."

When I try this by running the example I get this:

onlineapp.d(27): Error: expected 2 arguments for getOverloads but had 3

Line 27 is:
```
27  foreach (t; __traits(getOverloads, D, "bar", true))
28      writeln(t.stringof);
```
https://run.dlang.io/is/eahvvt

I don't know whether it's the spec or implementation, but one of them is incorrect.
Comment 1 basile-z 2018-06-11 21:46:05 UTC
This feature is not yet released. You need DMD ~master or the nightly to test it.
Unfortunately on run.dlang.io the nightly seems to be out of date but for example locally your paste works.
Comment 2 basile-z 2018-06-11 21:47:02 UTC
However it's true that the DDOC has been merged too eagerly, leading to confusion.