Method overloading leads to call first defined one if number of arguments does not match #13
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Aer Information
d1b874b391
Your problem description
PH7 takes first method defined, if it does not match the arguments list.
This shows well below example, which defines 3 methods with the same name. Each of them takes different number of arguments.
Should we treat this as a bug or as a feature?
Expected results
As PH7 does not emit any errors, expected output is:
I take 0 arguments
I take 1 argument
I take 2 arguments
Current results
Actual result is:
I take 0 arguments
I take 1 argument
I take 2 arguments
I take 0 arguments
This behaviour might lead to subtle bugs I think.
I added variadic functions to the ideas for future releases. There are already a lot of things to do and I think we can skip this feature for now. I think P# should strictly match number of arguments for now, doesnt it?