Is there anything fundamentally wrong with this code?

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Feb 5 01:41:57 PST 2017


On Sunday, February 05, 2017 02:19:35 Era Scarecrow via Digitalmars-d-learn 
wrote:
> On Friday, 3 February 2017 at 18:37:15 UTC, Johan Engelen wrote:
> > The error is in this line. Instead of assigning to the
> > `postProc` at module scope, you are defining a new local
> > variable and assigning to it.
>
>   Wasn't the compiler suppose to warn you when you are shadowing
> another variable? Or is that only with two local ones?

Local variables cannot shadow other local variables. All other levels of
shadowing are allowed.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list