[Issue 6812] Failed equality of structs with string field
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Oct 13 17:54:11 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6812
--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2011-10-13 17:53:17 PDT ---
Class type has same problem.
struct Foo {
string s;
}
struct Bar {
static class X {
bool opEquals(Object o){ return true; }
}
X x;
}
void main() {
Foo f1 = Foo("hello".idup);
Foo f2 = Foo("hello".idup);
assert(f1 !is f2); // OK
assert(f1 == f2); // error
Bar b1 = Bar(new Bar.X());
Bar b2 = Bar(new Bar.X());
assert(b1 !is b2); // OK
assert(b1 == b2); // error!
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list