D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21661 - Can't use fully-qualified name of the current module inside an expression
Summary: Can't use fully-qualified name of the current module inside an expression
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-02-24 15:23 UTC by Boris Carvajal
Modified: 2021-02-26 08:47 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 Boris Carvajal 2021-02-24 15:23:23 UTC
Test:
-----
module pkg.pkg2.test;

enum x = 1;

pragma(msg, pkg.pkg2.test.stringof);
pragma(msg, pkg.pkg2.test.x.stringof);
-----

Output:
onlineapp.d(5): Error: undefined identifier pkg2 in package pkg, perhaps add static import pkg.pkg2;
onlineapp.d(5):        while evaluating pragma(msg, package pkg.pkg2.test.stringof)
onlineapp.d(6): Error: undefined identifier pkg2 in package pkg, perhaps add static import pkg.pkg2;
onlineapp.d(6):        while evaluating pragma(msg, package pkg.pkg2.test.x.stringof)


Program compiles fine when the module declaration is a single identifier.
Comment 1 Dlang Bot 2021-02-24 15:49:57 UTC
@BorisCarvajal created dlang/dmd pull request #12230 "Fix Issue 21661 - Can't use fully-qualified name of the current modul…" fixing this issue:

- Fix Issue 21661 - Can't use fully-qualified name of the current module inside an expression

https://github.com/dlang/dmd/pull/12230
Comment 2 Dlang Bot 2021-02-26 08:47:26 UTC
dlang/dmd pull request #12230 "Fix Issue 21661 - Can't use fully-qualified name of the current modul…" was merged into master:

- 2f58848f8ce06a19060d01a5032177de51895df2 by Boris Carvajal:
  Fix Issue 21661 - Can't use fully-qualified name of the current module inside an expression

https://github.com/dlang/dmd/pull/12230