Overloading local function with same name as enclosing function #633
Unanswered
dotjpg3141
asked this question in
General
Replies: 1 comment
-
I believe this is the expected behavior right now. Local functions don't behave like methods that can be overloaded, they behave like local variables. And if you have a local variable that has the same name as the enclosing method, only the local variable can be directly referenced. If you're looking for a workaround, you could use |
Beta Was this translation helpful? Give feedback.
0 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.
-
Overloading local function with same name as the enclosing function gives a compiler error:
Expected behaviour:
It compiles
Actual behaviour:
CS1501: No overload for method 'Sum' takes 1 arguments.
If I rename the local function to something other than
Sum
it will compile.Beta Was this translation helpful? Give feedback.
All reactions