Summary: Initializing const members in derived classes'
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: DMD

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

class C
    immutable int x;

class D : C
        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:
------- You are receiving this mail because: -------

Reply via email to