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

           Summary: Template constructor cannot initialize non-mutable
                    field
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara <k.hara...@gmail.com> 2011-07-20 02:17:09 PDT ---
This is valid D2 code, but couldn't compile.

----
struct S
{
    const int value;
    this()(int n){ value = n; }
}
void main()
{
    S s = S(10);
}
----
test.d(4): Error: can only initialize const member value inside constructor
test.d(8): Error: template instance test.S.__ctor!() error instantiating
----

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

Reply via email to