digitalmars.D.bugs - [Issue 2641] New: std.variant Variant's check for "can append" is wrong
- d-bugmail puremagic.com (36/36) Feb 01 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2641
- d-bugmail puremagic.com (6/6) Feb 01 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2641
- d-bugmail puremagic.com (11/11) Jul 07 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2641
http://d.puremagic.com/issues/show_bug.cgi?id=2641 Summary: std.variant Variant's check for "can append" is wrong Product: D Version: 2.023 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: bugzilla digitalmars.com ReportedBy: wbaxter gmail.com The code below used in std.variant seems to be assuming that if a type can be indexed, then it can also be appended to: ----- case OpID.catAssign: auto me = cast(A*) pStore; static if (is(typeof((*me)[0])) && !is(typeof(me.keys))) { // array type; parm is the element to append auto arg = cast(VariantN*) parm; alias typeof((*me)[0]) E; if (arg[0].convertsTo!(E)) { // append one element to the array (*me) ~= [ arg[0].get!(E) ]; } else { // append a whole array to the array (*me) ~= arg[0].get!(A); } --- This causes it to fail when trying to use a fixed-length struct, like a fixed vec3 that provides an opIndex but no opCatAssign. --
Feb 01 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2641 andrei metalanguage.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --
Feb 01 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2641 Andrei Alexandrescu <andrei metalanguage.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED 10:06:58 PDT --- Fixed in future 2.032 (and checked in for the impatient). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 07 2009