[Issue 10584] New: Unhelpful error default constructing nested class

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 9 11:21:07 PDT 2013


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

           Summary: Unhelpful error default constructing nested class
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: peter.alexander.au at gmail.com


--- Comment #0 from Peter Alexander <peter.alexander.au at gmail.com> 2013-07-09 11:21:07 PDT ---
class A
{
    class B {}
    B b = new B();
}

Error: 'this' is only defined in non-static member functions, not A.

This error isn't particularly helpful, since I don't explicitly request this.
The error should state that constructing B requires a this reference, which
isn't available for default construction.

-- 
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