I was implementing some generic IEqualityComparer<T>
Equal()
method when the code in the switch is unreachable without visible reason for me:
public bool Equals(T x, T y)
{
switch (nameof(T))
{
case nameof(Accessory):
return (x as Accessory).Id == (y as Accessory).Id;//not reachable
default:
return false;
}
}
Someone has a clue?