http://d.puremagic.com/issues/show_bug.cgi?id=3789
Kenji Hara <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Platform|Other |All Depends on| |1824 --- Comment #11 from Kenji Hara <[email protected]> 2011-10-14 02:46:10 PDT --- Test case. void main() { static struct Float { double x; } Float f; assert(f.x != f.x); // NaN != NaN assert(f != f); // Fails, should pass static struct Array { int[] x; } Array a1 = Array([1,2,3].dup); Array a2 = Array([1,2,3].dup); assert(a1.x !is a2.x); assert(a1.x == a2.x); assert(a1 == a2); // Fails, should pass static struct Class { Object x; } static class X { bool opEquals(Object o){ return true; } } Class c1a = Class(new Object()); Class c2a = Class(new Object()); assert(c1a.x !is c2a.x); assert(c1a.x != c2a.x); assert(c1a != c2a); // Pass, Object.opEquals works like bitwise compare Class c1b = Class(new X()); Class c2b = Class(new X()); assert(c1b.x !is c2b.x); assert(c1b.x == c2b.x); assert(c1b == c2b); // Fails, should pass } To fix the comparison behavior of a struct that has classes as members, we need to fix the bug 1824 first. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
