Ah, then how about Section 10.3, paragraph 3, items 18 and 19? 18 The local variable declaration space of a block includes any nested blocks. 19 Thus, within a nested block it is not possible to declare a local variable with the same name as a local variable in an enclosing block.
Jim > -----Original Message----- > From: Jon Jagger [mailto:[EMAIL PROTECTED]] > Sent: 17 May 2002 17:13 > To: [EMAIL PROTECTED] > Subject: Re: [DOTNET] Is this program conforming? > > > On Fri, 17 May 2002 07:34:34 -0700, Jim Arnold > <[EMAIL PROTECTED]> > wrote: > > >[From the SDK docs] > > > >"A local variable named 'var' cannot be declared in this > scope because it > >would give a different meaning to 'var', which is already used in > a 'parent > >or current' scope to denote something else". > > > Sorry, I should have been more explicit. > > I know this is the error you get from the Microsoft C# > compiler. What I do > not know and have not been able to find out is exactly which > sentence from > the language specification the Microsoft C# compiler writers > are complying > with when they issue this error message. > > I cannot argue with the error message itself. _if_ I "used" > 'var' in the > scope it _would_ indeed give a different meaning to 'var' > which is indeed > already in used in a parent scope. But what does "use" mean? > It appears to > mean "used in a declarator" but the nearest I can get to that > in the spec > is "used in an expression" which I'm not doing (unless I'm missing > something) > > Cheers > JJ > > You can read messages from the DOTNET archive, unsubscribe > from DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.