digitalmars.D.bugs - [Issue 7312] New: const should be abstract
- d-bugmail puremagic.com Jan 18 2012
- d-bugmail puremagic.com Jan 18 2012
- d-bugmail puremagic.com Jan 18 2012
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: nobody puremagic.com ReportedBy: timon.gehr gmx.ch --- Comment #0 from timon.gehr 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: -------
Jan 18 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7312 Jonathan M Davis <jmdavisProg gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jmdavisProg gmx.com --- Comment #1 from Jonathan M Davis <jmdavisProg gmx.com> 2012-01-18 13:55:00 PST --- I can see why it would be considered bad practice to return const from a strongly pure function, but why should it be disallowed by the compiler? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 18 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7312 timon.gehr gmx.ch changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P2 |P3 --- Comment #2 from timon.gehr gmx.ch 2012-01-18 14:25:22 PST --- Immutable has all the constraints const has and gives actual guarantees. I don't think it is very important to enforce it, but it would be a net gain. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 18 2012









d-bugmail puremagic.com 