Let's say I have a small example class:
public class Test
{
public Test() {}
public List<int> Numbers { get; set; } = new List<int>();
public void AddNumber(int number) => Numbers.Add(number);
public void RemoveNumber(int number) => Numbers.Remove(number);
}
How come the above excerpt does not give any warnings or errors when the void return type method named RemoveNumber uses the bool return type List<int>.Remove(int item) method? Should the return types of both the calling method and the called method not match?