www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20537] New: traits isPackage/isModule and is(package/module)


          Issue ID: 20537
           Summary: traits isPackage/isModule and is(package/module) fail
                    on single level package.d import
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: boris2.9 gmail.com


mkdir p
touch p/package.d

import p;

static assert(is(p == package));       // <- fails
static assert(__traits(isPackage, p)); // <- fails
static assert(is(p == module));
static assert(__traits(isModule, p));

dmd testp.d

It should be true in both cases.

Jan 26 2020