www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21625] New: Mixed-in unittests can collide with other unittests

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

          Issue ID: 21625
           Summary: Mixed-in unittests can collide with other unittests
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: maxsamukha gmail.com

enum test = q{
unittest {}
};

mixin(test);
unittest {
    assert(false); // this never runs
}

void main() {
}

The mixed-in unittest hides the other unittest because the same name is
generated for both.

--
Feb 10