[Issue 10496] New: Initialization in lazy function parameter allows immutable member not to be initialized

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 28 09:00:45 PDT 2013


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: nobody at puremagic.com
        ReportedBy: david.eckardt at sociomantic.com


--- Comment #0 from David Eckardt <david.eckardt at sociomantic.com> 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: -------


More information about the Digitalmars-d-bugs mailing list