www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15498] New: Unhelpful error message "destructors, postblits

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 puremagic.com
          Reporter: turkeyman 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.

--
Jan 02 2016