[Issue 15498] New: Unhelpful error message "destructors, postblits and invariants are not allowed in overlapping fields"

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Jan 2 03:33:48 PST 2016


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

          Issue ID: 15498
           Summary: Unhelpful error message "destructors, postblits and
                    invariants are not allowed in overlapping fields"
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: turkeyman at gmail.com

This error has been bugging me for hours. I have no idea what it means, or why
it's happening.

Error: struct libep.componentdesc.ComponentDesc destructors, postblits and
invariants are not allowed in overlapping fields info and baseClass

There are no unions in sight... what's the deal?


Here's the code:

struct ComponentInfo
{
  SharedString id;
}

struct ComponentDesc
{
  ComponentInfo info;
  SharedString baseClass;
}


SharedString is:

  extern(C++, ep) struct SharedString { /+ some stuff +/ }



Assuming this is some sort of user error, I would like to suggest that this bug
is to improve the error message and tell me what is actually wrong. I can't do
anything with this.

--


More information about the Digitalmars-d-bugs mailing list