Calling method is not an assignment. I mean, where is the assignment (=) when you call a function?
That’s exactly what I said. If you worry about the performance issue (which is basically none for this case no matter how many time you do it for machine integer types), you should pass in a UInt8 from the beginning. The two versions of code have no difference when you do that. If you want to pass in a non UInt8, you’ll always have a conversion and what you wanted is simply putting that on the function call, which makes absolutely no difference in this case. If you actually care about avoiding conversion, as I said abve, you should be very happy about the current behavior since it makes sure you never pass in anything other than the correct type and therefore avoid any conversions.
I do not disagree with that. But,
- That’s not a inconsistency since method call is not an assignment.
- This is a necessary trade off to make it fit everything else. It does lead to more confusing cases when you have more than one methods and there’s an issue for it. In any case, this (default parameter) is an isolated case on it’s own that has absolutely nothing to do with all other cases you’ve brought up.