Bug 11011 – core.time.Duration has example code which cannot compile
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-11T06:56:00Z
Last change time
2014-04-27T22:20:14Z
Keywords
pull
Assigned to
andrej.mitrovich
Creator
dlang-bugzilla
Comments
Comment #0 by dlang-bugzilla — 2013-09-11T06:56:26Z
An example in core.time.Duration's documentation reads:
assert(dur!"hnsecs"(27) == Duration(27));
However, attempting to compile this example (outside of core.datetime) results in the error message:
struct core.time.Duration member this is not accessible
Thus, either the constructor needs to be made public, or the documentation updated to fix or remove unusable examples.
Comment #1 by issues.dlang — 2013-09-11T09:48:16Z
Well, it _is_ equivalent, and the example shows what it's doing, but no, the constructor is not supposed to be callable outside of core.time. So, that example should be removed.
Comment #2 by andrej.mitrovich — 2014-04-27T18:50:14Z