[Issue 8955] New: Can't have qualified field with not-qualified constructor/postblit

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 3 05:55:15 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8955

           Summary: Can't have qualified field with not-qualified
                    constructor/postblit
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2012-11-03 15:55:14 MSK ---
Currently constructor/postblit isn't qualified (see Issue 4338 and Issue 4867).
But it's violated for struct members:

---
struct S
{
    this(this) { }
    ~this() { }
}

struct S2
{ S s; }

const S  globalS;  // ok
const S2 globalS2; // ok

void f()
{
    const S  localS;  // ok
    const S2 localS2; // ok
}


struct S3 // or class, or union
{ const S s; } // any qualifier causes errors
---


Errors for S with postblit only:
---
Error: function main.S.__postblit () is not callable using argument types ()
const
---


Errors for S with destructor ony (note generated `opAssign`):
---
Error: destructor main.S.~this () is not callable using argument types () const
Error: function main.S.opAssign (S p) is not callable using argument types
(const(S)) const
---


Errors for S with postblit and destructor:
---
Error: destructor main.S.~this () is not callable using argument types () const
Error: function main.S.__postblit () is not callable using argument types ()
const
---


There is no line numbers in errors because of Issue 8954.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list