Bug 18972 – __traits(getOverloads) example with 3rd argument doesn't compile
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-06-11T21:19:15Z
Last change time
2020-03-21T03:56:35Z
Assigned to
No Owner
Creator
Dennis
Comments
Comment #0 by dkorpel — 2018-06-11T21:19:15Z
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 by b2.temp — 2018-06-11T21:46:05Z
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 by b2.temp — 2018-06-11T21:47:02Z
However it's true that the DDOC has been merged too eagerly, leading to confusion.