public override bool Equals(object obj) { NumberOrString other = obj as NumberOrString; return(other == null ? false : Equals(other)); }
public bool Equals(NumberOrString other) => (IsLeft && other.IsLeft) ? (Left == other.Left) : (IsRight && other.IsRight) ? (Right == other.Right) : (!IsLeft && !IsRight && !other.IsLeft && !other.IsRight); // None == None
public bool Equals(NumberOrString other) { return(IsLeft && other.IsLeft ? Left == other.Left : IsRight && other.IsRight ? Right == other.Right : !IsLeft && !IsRight && !other.IsLeft && !other.IsRight); }