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

           Summary: Initialization in lazy function parameter allows
                    immutable member not to be initialized
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from David Eckardt <[email protected]> 2013-06-28 
09:00:44 PDT ---
class C
{
    immutable int x;

    this()
    {
        this.f(this.x = 5);
    }

    void f(lazy int x){}
}

C.int isn't initialized, although this code compiles.
Whether C.int is initialized or not depends on the, in general indeterministic,
behavior of f(), this should be a compile time error.

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

Reply via email to