digitalmars.D.bugs - [Issue 7342] New: structs don't call the right opEquals on contained arrays
- d-bugmail puremagic.com (37/37) Jan 21 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7342
- d-bugmail puremagic.com (13/13) Jan 22 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7342
http://d.puremagic.com/issues/show_bug.cgi?id=7342 Summary: structs don't call the right opEquals on contained arrays Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: major Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: bearophile_hugs eml.cc --- Comment #0 from bearophile_hugs eml.cc 2012-01-21 15:52:25 PST --- This assert fires, but this is wrong: const struct Foo { int[] a; } void main() { Foo f1 = Foo([1, 2]); Foo f2 = Foo([1] ~ 2); assert(f1 !is f2); // OK assert(f1 == f2); // AssertError } It's a source of bugs, like: import std.stdio; const struct Foo { int[] a; } void main() { int[const Foo] aa; aa[Foo([1, 2])] = 1; aa[Foo([1] ~ [2])] = 2; writeln(aa); } [const(Foo)([1, 2]):1, const(Foo)([1, 2]):2] Please fix this. I have set the "major" Severity (almost "Critical") because this causes some of the worst bugs I have had in single-threaded D code. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 21 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7342 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE --- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2012-01-22 05:39:36 PST --- This is part of 3789. See http://d.puremagic.com/issues/show_bug.cgi?id=3789#c11 *** This issue has been marked as a duplicate of issue 3789 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 22 2012