Private optional parameters #7762
Unanswered
zms9110750
asked this question in
Language Ideas
Replies: 1 comment 5 replies
-
Sounds like something better accomplished through overloads. Optional parameters don't affect the signature of the method and it doesn't make sense to have an "optional" parameter that cannot be provided by a caller. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can add modifiers to optional parameters (just like the accessor in a property, only allowing lower access permissions than the property).
Currently, overloading methods often involves a combination of parameter arrangements. They are either logically similar or simply working parameters and then calling another overload.
I am currently facing a problem where I need to recurse a method. The call of this method cannot allow external modifications to the parameters I use for iteration.
So, I created a new method that doesn't have parameters for iteration. But I think this method is more than enough. It would be great if they could merge together.
Beta Was this translation helpful? Give feedback.
All reactions