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

           Summary: Call to immutable method during immutable construction
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: jens.k.muel...@gmx.de


--- Comment #0 from jens.k.muel...@gmx.de 2010-11-11 01:39:13 PST ---
According to TDPL p. 294 a call to any non-static method in an immutable
constructor is not allowed.

But
class A {
    int a;
    this() immutable {
       a = 5;
       fun(); // should not compile
    }

    void fun() immutable {}
}

compiles with dmd v2.050.
I think the behavior should be clarified. Either in dmd to match TDPL or the
other way round.
I'm going to add a link to a thread on digitalmar...@puremagic.com for further
information.

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

Reply via email to