Summary: const should be abstract
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from 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:
------- You are receiving this mail because: -------

Reply via email to