D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 18131 - Not possible to unittest package symbol outside of package
Summary: Not possible to unittest package symbol outside of package
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-27 13:51 UTC by Jacob Carlborg
Modified: 2024-12-13 18:55 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jacob Carlborg 2017-12-27 13:51:58 UTC
If a symbol is declared with "package" it's not possible to access it inside a unittest block if the module is not inside a package. Example:

$ cat foo.d
package void bar() {}

unittest
{
    bar();
}

$ dmd -unittest foo.d
foo.d(5): Error: function foo.bar is not accessible from module foo
Comment 1 dlangBugzillaToGithub 2024-12-13 18:55:46 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17827

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB