www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5200] New: Call to immutable method during immutable construction

reply d-bugmail puremagic.com writes:
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: nobody puremagic.com
        ReportedBy: jens.k.mueller gmx.de


--- Comment #0 from jens.k.mueller 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 digitalmars-d puremagic.com for further
information.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 11 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5200



--- Comment #1 from jens.k.mueller gmx.de 2010-11-16 09:28:38 PST ---
Somehow only the first message of the thread is available. See
http://www.digitalmars.com/d/archives/digitalmars/D/Call_to_immutable_method_during_immutable_construction_121623.html

The rest is here
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=121637

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 16 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5200


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|x86_64                      |x86


--- Comment #2 from Brad Roberts <braddr puremagic.com> 2011-02-06 15:40:16 PST
---
Mass migration of bugs marked as x86-64 to just x86.  The platform run on isn't
what's relevant, it's if the app is a 32 or 64 bit app.

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