www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19401] New: Fix bug in

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

          Issue ID: 19401
           Summary: Fix bug in core.internal.traits.hasElaborateDestructor
                    for struct with static array alias
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: n8sh.secondary hotmail.com

Example:

https://run.dlang.io/is/6k5F17
---
import std.stdio;

struct S
{
    int[4] a;
    alias a this;
    enum length = 1;

    ~this() { writeln("elaborate!"); }
}

void main()
{
    import std.traits : hasElaborateDestructor1 = hasElaborateDestructor;
    import core.internal.traits : hasElaborateDestructor2 =
hasElaborateDestructor;
    writeln(hasElaborateDestructor1!S);
    writeln(hasElaborateDestructor2!S);
}
---

--
Nov 14 2018