[Issue 21661] New: Can't use fully-qualified name of the current module inside an expression

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 24 15:23:23 UTC 2021


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

          Issue ID: 21661
           Summary: Can't use fully-qualified name of the current module
                    inside an expression
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: boris2.9 at gmail.com

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.

--


More information about the Digitalmars-d-bugs mailing list