← Back to context

Comment by Certhas

10 months ago

Yes, the second case is a bug in the interface.

For the first case you have it the wrong way around. My generic code would work on things that are not numbers but I prevent you from calling it because I didn't anticipate that there would be things you can add that are not numbers. (Better example: require an array when you really only need an iterable).