www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21330] New: __traits(getUnitTests) on a module should include


          Issue ID: 21330
           Summary: __traits(getUnitTests) on a module should include
                    unittests from anonymous mixins
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: maxsamukha gmail.com

mixin template Test() {
    unittest {

    void foo() {
mixin Test;

pragma(msg, __traits(allMembers, onlineapp)); // tuple("object", "Test", "foo",
pragma(msg, __traits(getUnitTests, onlineapp)); // tuple()

void main() {

If allMembers returns "foo", then it is reasonable to expect that getUnitTests
should return the unittest. Actually, it it impossible to get to the unittest
at all because it is impossible to refer to anonymous mixins explicitly.

Oct 19 2020