Bug 11959 – Phobos should not declare public symbols in version(unittest) blocks

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-21T09:53:43Z
Last change time
2018-08-26T20:56:50Z
Assigned to
No Owner
Creator
dransic

Attachments

IDFilenameSummaryContent-TypeSize
1315public-unittest-symbols-phobos.txtList of public unittest symbolstext/plain2483

Comments

Comment #0 by dransic — 2014-01-21T09:53:43Z
I think that Phobos shouldn't declare public symbols in version(unittest) blocks, as these can conflict with unittests in user code. Many of them have names that are unlikely to appear in user code. But others are quite common (e.g. Length, in std.range). See attached list for a quickly generated list of such symbols.
Comment #1 by dransic — 2014-01-21T09:54:45Z
Created attachment 1315 List of public unittest symbols
Comment #2 by github-bugzilla — 2018-08-26T20:56:49Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/db819575f13b6de9a726e74e3ce29aaa0be1b361 Fix issue 11959 - Set private symbols declared in version(unittest) blocks https://github.com/dlang/phobos/commit/dc40232b6074e53c13aa47e1ef4d0b5990745fc5 Merge pull request #6681 from BBasile/pub-symbol-unittest Fix issue 11959 - Set private symbols declared in version(unittest) blocks merged-on-behalf-of: Petar Kirov <[email protected]>