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

          Issue ID: 15571
           Summary: .dup is incompatible with self referencing structs
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

.dup is not compatible with self-referencing structs: This code does not
compile due to the .dup operation:

template Wrapper(T) {
  struct Wrapper {
    private T[] _holder;
    this(this) {
      _holder = _holder.dup;
    }
  }
}

unittest {
  struct Node {
    Wrapper!Node next;
  };
}

--

Reply via email to