www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19661] New: DMD 2.084.0 SIGSEGV in std.traits.isFunction

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

          Issue ID: 19661
           Summary: DMD 2.084.0 SIGSEGV in std.traits.isFunction
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: flyboynw gmail.com

This code produces a SIGSEGV in DMD 2.084.0 when attempting to find all
functions in the same module as the code itself is in.

module test;

public immutable bool testModule = testFunctionMembers!"test";

public void testFunctionMembers(string module_)() {
    import std.traits : isFunction;
    mixin(`import dmodule = ` ~ module_ ~ `;`);
    foreach(member; __traits(allMembers, dmodule)) {
        const bool isfunc = isFunction!(__traits(getMember, dmodule, member));
    }
}

--
Feb 08 2019