Bug 18131 – Not possible to unittest package symbol outside of package

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-12-27T13:51:58Z
Last change time
2024-12-13T18:55:46Z
Assigned to
No Owner
Creator
Jacob Carlborg
Moved to GitHub: dmd#17827 →

Comments

Comment #0 by doob — 2017-12-27T13:51:58Z
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 by robert.schadek — 2024-12-13T18:55:46Z
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