Community

> void main ()
> {
> { int f0 () { return 10 ; } }
>
> { int f0 () { return 20 ; } }
> }
Stewart Gordon wrote:
> Looks like a bug.
The compiler recognizes the situation and reports it as an error, so it
seems like this is not a bug, but something which is not supported:
~/scratch $ rdmd test_scope_a.d
test_scope_a.d(6): Error: declaration f0 is already defined in
another scope in main
The rationale in TDPL that Andrei pointed to doesn't seem to cover the
case above.
Can anyone confirm that the above really is against the rules of the
language?
Ed