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

           Summary: Initializing const members in derived classes'
                    constructors
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: thecybersha...@gmail.com


--- Comment #0 from Vladimir Panteleev <thecybersha...@gmail.com> 2012-01-03 
11:39:16 PST ---
I believe this code is valid:

class C
{
    immutable int x;
}

class D : C
{
    this()
    {
        x = 42;
    }
}

Compiler complains:
test.d(10): Error: can only initialize const member x inside constructor

Even if this code is invalid, the error message is misleading in this case.

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

Reply via email to