[Issue 18131] New: Not possible to unittest package symbol outside of package

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 27 13:51:58 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=18131

          Issue ID: 18131
           Summary: Not possible to unittest package symbol outside of
                    package
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: doob at me.com

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

--


More information about the Digitalmars-d-bugs mailing list