Jump to page: 1 2
Thread overview
[Issue 15498] Unhelpful error message "destructors, postblits and invariants are not allowed in overlapping fields"
Mar 26, 2016
Manu
Mar 28, 2016
Kenji Hara
Mar 28, 2016
Kenji Hara
Mar 28, 2016
Kenji Hara
Jul 22, 2016
Marco Leise
May 06, 2018
Manu
March 26, 2016
https://issues.dlang.org/show_bug.cgi?id=15498

--- Comment #1 from Manu <turkeyman@gmail.com> ---
I'm still stuck on this... what does the error mean?

--
March 26, 2016
https://issues.dlang.org/show_bug.cgi?id=15498

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com

--- Comment #2 from Steven Schveighoffer <schveiguy@yahoo.com> ---
the /+ some stuff +/ might be the cause. I don't see any postblits, invariants, etc. anywhere either.

Can you elaborate there? Maybe a minimal reproduction?

--
March 28, 2016
https://issues.dlang.org/show_bug.cgi?id=15498

--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> ---
Minimized example code that compiler shows the error message.

struct X
{
    this(this) {}
    // or: ~this() {}
    // or: invariant {}
}

union U // Error
{
    X x;
    int overlapping;
}

struct S // Error
{
    union
    {
        X x;
        int overlapping;
    }
}

For U or S, compiler cannot generate destructors, postblits, or invariants automatically, because the field x typed X overlapping with other fields.

--
March 28, 2016
https://issues.dlang.org/show_bug.cgi?id=15498

--- Comment #4 from Steven Schveighoffer <schveiguy@yahoo.com> ---
(In reply to Kenji Hara from comment #3)
> Minimized example code that compiler shows the error message.

But what about if there are no unions? Manu says no unions are being used.

In his code, there is no unions where the error is being printed (info
conflicts with baseClass).

--
March 28, 2016
https://issues.dlang.org/show_bug.cgi?id=15498

--- Comment #5 from Kenji Hara <k.hara.pg@gmail.com> ---
(In reply to Steven Schveighoffer from comment #4)
> But what about if there are no unions? Manu says no unions are being used.
> 
> In his code, there is no unions where the error is being printed (info
> conflicts with baseClass).

If there's no unions (overlapped fields), the error print would be a compiler
bug.

Honestly I cannot say anything until I see what the "some stuff" actually is.

--
March 28, 2016
https://issues.dlang.org/show_bug.cgi?id=15498

--- Comment #6 from Steven Schveighoffer <schveiguy@yahoo.com> ---
(In reply to Kenji Hara from comment #5)
> If there's no unions (overlapped fields), the error print would be a
> compiler bug.
> 
> Honestly I cannot say anything until I see what the "some stuff" actually is.

I would also like to see what is in there, but even without that, the error report is at least misleading.

Note the error once again:

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

And the struct ComponentDesc:

struct ComponentDesc
{
  ComponentInfo info;
  SharedString baseClass;
}

Is there any way to define ComponentInfo or SharedString such that info and baseClass overlap? I wouldn't think so.

--
March 28, 2016
https://issues.dlang.org/show_bug.cgi?id=15498

--- Comment #7 from Kenji Hara <k.hara.pg@gmail.com> ---
(In reply to Steven Schveighoffer from comment #6)
> Is there any way to define ComponentInfo or SharedString such that info and baseClass overlap? I wouldn't think so.

I don't know. So this is funny issue. I'm waiting more information from Manu.

--
June 14, 2016
https://issues.dlang.org/show_bug.cgi?id=15498

joeyemmons@yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joeyemmons@yahoo.com

--- Comment #8 from joeyemmons@yahoo.com ---
I am getting this too, definitely don't have any unions. My issue seems to be caused by some kind of import ordering problem, reordering some of my imports makes it go away. Making a minimized reproduction might be hard.

--
June 14, 2016
https://issues.dlang.org/show_bug.cgi?id=15498

--- Comment #9 from joeyemmons@yahoo.com ---
Created attachment 1601
  --> https://issues.dlang.org/attachment.cgi?id=1601&action=edit
Shows Issue 15498

The error seems to be printed for no reason at all except to confuse things...

--
June 14, 2016
https://issues.dlang.org/show_bug.cgi?id=15498

--- Comment #10 from Steven Schveighoffer <schveiguy@yahoo.com> ---
(In reply to joeyemmons from comment #9)
> Created attachment 1601 [details]
> Shows Issue 15498
> 
> The error seems to be printed for no reason at all except to confuse things...


Hm.. definitely the error is confusing, but the code itself has another error (hwCursorRef is not defined).

Do you have a reproduction that doesn't involve another error?

--
« First   ‹ Prev
1 2