[Issue 4589] New: comparing two arrays of interfaces for equality segfaults
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Aug 5 10:50:36 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4589
Summary: comparing two arrays of interfaces for equality
segfaults
Product: D
Version: D2
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: schveiguy at yahoo.com
--- Comment #0 from Steven Schveighoffer <schveiguy at yahoo.com> 2010-08-05 10:50:34 PDT ---
Example case:
interface I
{
}
class C: I
{
this(int x)
{
this.x = x;
}
int x;
override bool opEquals(Object o)
{
if(auto c = cast(C)o)
{
return c.x == x;
}
return false;
}
}
void main()
{
I[] arr;
I[] arr2;
arr ~= new C(1);
arr2 ~= new C(1);
assert(arr == arr2);
}
Note, the opEquals isn't important, but I also want to ensure that after the
segfault is removed the correct thing is done. Currently comparing two
interfaces for equality does not work.
I'm unsure whether this is a druntime or a dmd problem.
--
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