This is due to implicit conversion in your structure type, i.e. in the following lines:
public static implicit operator Int32(Point p) { Console.WriteLine("Converted to Int32"); return py + px; }
So, the compiler treats your Point type as a whole, invoking the above implicit conversion method.
To fix this, you need to either remove the implicit conversion from your type, or use the ToString () method by executing Console.WriteLine ()
This should fix your problem. Hope this helps.
The best
frostedcoder
source share