digitalmars.D.bugs - [Issue 6453] New: Allow multiple invariant per struct/class
- d-bugmail puremagic.com Aug 08 2011
- d-bugmail puremagic.com Jan 28 2012
- d-bugmail puremagic.com Jan 28 2012
- d-bugmail puremagic.com Feb 23 2012
- d-bugmail puremagic.com Jan 16 2013
http://d.puremagic.com/issues/show_bug.cgi?id=6453 Summary: Allow multiple invariant per struct/class Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: simendsjo gmail.com --- Comment #0 from simendsjo <simendsjo gmail.com> 2011-08-08 03:19:03 PDT --- I would like to use a template mixin to add some fields to a struct, but I'd also like the template to add additional invariant checks without having to remember to add this for all struct/classes that mixes in this code. class C { int a; } mixin template EmbedC() { C _c; // oops.. more than one invariant invariant() { assert(_c); } void close() { _c = null; } } struct S { int i = 10; invariant() { assert(i >= 10); } mixin EmbedC!(); } void main() { S s; s.close(); s._c.a = 10; // access violation, but I want assertion from invariant } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 08 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6453 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ddoc CC| |yebblies gmail.com Platform|Other |All AssignedTo|nobody puremagic.com |yebblies gmail.com OS/Version|Windows |All Severity|normal |enhancement --- Comment #1 from yebblies <yebblies gmail.com> 2012-01-29 15:41:25 EST --- The spec explicitly states that there can only be one invariant, so this is an enhancement. On the other hand, this appears to be an arbitrary restriction. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 28 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6453 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch --- Comment #2 from yebblies <yebblies gmail.com> 2012-01-29 17:25:04 EST --- https://github.com/D-Programming-Language/dmd/pull/653 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 28 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6453 Alex Rønne Petersen <xtzgzorex gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xtzgzorex gmail.com --- Comment #3 from Alex Rønne Petersen <xtzgzorex gmail.com> 2012-02-23 12:59:01 PST --- I completely agree with this change; I ran into this exact limitation for the exact same scenario as well. It's rather crippling for template mixins. While on this topic, see also bug #5038. It would be a natural extension of this enhancement IMHO. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 23 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6453 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ah08010-d yahoo.com --- Comment #4 from yebblies <yebblies gmail.com> 2013-01-17 01:28:15 EST --- *** Issue 5038 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 16 2013









d-bugmail puremagic.com 