Is it intended that local functions can't be polymorphic?

Example:

void foo(int x) {}
void foo(string x) {}

void bar() {
   void foo(int x) {}
   void foo(string x) {}
}

void main() {
}

The error (at line 6) is "declaration foo is already defined".

The code compiles if you comment out at least one of the local functions (but not if you, for example, comment out the global ones, of course).

Is this a bug, or am I just missing the reasoning behind it? Any workarounds? (I'm still at 2.052, so maybe this works in the new version?)

--
Magnus Lie Hetland
http://hetland.org

Reply via email to