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

           Summary: const should be abstract
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-01-18 11:03:10 PST ---
const only has a meaning in presence of aliasing. Unique const data is
meaningless. const is abstract. strongly pure functions should not be allowed
to return const; they can return mutable or immutable data instead.

static assert(!is(typeof(new const(Object))));
static assert(!is(typeof(new const(int)[1])));
static assert(!is(typeof({const(Object) foo(){return new Object;}})));
static assert(!is(typeof({const(int)[] foo(){return new int[1];}})));

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

Reply via email to