Bug 15395 – unittest can't access symbol of visibility package

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2015-12-02T16:23:00Z
Last change time
2015-12-03T23:58:36Z
Assigned to
nobody
Creator
andre

Comments

Comment #0 by andre — 2015-12-02T16:23:34Z
For following coding there is an error during compilation: module utils; package string toBulkString(string s) { import std.string: format; return "$%s\r\n%s\r\n".format(s.length, s); } unittest { string actual = "foobar".toBulkString(); //... } >> source\utils.d(11,39): Error: function utils.toBulkString is not accessible from module utils The error disappears if I change the visibility attribute from package to private.
Comment #1 by issues.dlang — 2015-12-03T23:58:36Z
This is arguable not a bug, since utils is not actually in a package. And the PR that was created to make it so that a module has access to package-level symbols in it even if it was not in a package was closed (Andrei was against it but was waiting for Walter, who never replied). *** This issue has been marked as a duplicate of issue 8716 ***