Ref.
http://groups.google.com/group/gallio-user/browse_thread/thread/144253d7be3efd43
The following scenario should be supported:
public class Foo : IEquatable<Foo>, IEquatable<string>
{
private readonly string text;
public string Text
{
get
{
return text;
}
}
public Foo(string text)
{
this.text = text;
}
public override bool Equals(object obj)
{
return Equals(obj as Foo) || Equals(obj as string);
}
public override int GetHashCode()
{
return text.GetHashCode();
}
public bool Equals(Foo other)
{
return (other != null) && (other.text == text);
}
public bool Equals(string other)
{
return (other != null) && (other == text);
}
}
Foo implements equality interfaces for 2 unrelated objects (Foo and
System.String). The fact that Foo and System.String do not derive from each
other is causing troubles when binding the equivalence classes.
Original issue reported on code.google.com by Yann.Tre...@gmail.com on 29 Sep 2010 at 6:32
Original issue reported on code.google.com by
Yann.Tre...@gmail.com
on 29 Sep 2010 at 6:32