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
Comment #3 by github-bugzilla — 2014-04-27T22:20:13Z
Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/ec3317c98d712e6ef2f99a17d6f6ea129e1453ee Fix Issue 11011 - Remove uncompilable example and use a documented unittest. https://github.com/D-Programming-Language/druntime/commit/bc83d2f578b1f96b8143f1c87de8f9da11c5cf6a Merge pull request #780 from AndrejMitrovic/Fix11011 Issue 11011 - Remove uncompilable example and use a documented unittest