Re: simple example
- From: "Tony Johansson" <johansson.andersson@xxxxxxxxx>
- Date: Wed, 16 Sep 2009 17:55:23 GMT
Hello!
As might expect I use VS05 with framework 2.0
//Tony
"Patrice" <http://scribe-en.blogspot.com/> skrev i meddelandet
news:eVauOVvNKHA.1236@xxxxxxxxxxxxxxxxxxxxxxx
This is it !
Error 1 A local variable named 'x' cannot be declared in this scope
because it would give a different meaning to 'x', which is already used
in a 'parent or current' scope to denote something else
F:\C#\ConsoleApplication1\ConsoleApplication1\Program.cs 322 14
ConsoleApplication1
This is what you get up to 2.0 (1.0 not tested ;-))
and NOT what you might expect
Error 1 The name 'x' does not exist in the current context
F:\C#\ConsoleApplication1\ConsoleApplication1\Program.cs 321 40
ConsoleApplication1
Rather than this one, with 3.5, you have "Cannot use local variable 'x'
before it is declared. The declaration of the local variable hides the
field 'ConsoleApplication1.Foo.x'." which looks much closer to what you
expect and is basically correct...
So it looks messages are improved in the 3.5 compiler. Prior 3.5 I agree
that the error message is totally misleading...
So, it's really best to always mention the version you are using when it
is not current. You may want to upgrade to 3.5 (the compiler is updated
but if you don't use new 3.5 libraires, you can benefit from new language
constructs as the underlying generated IL code still targets the 2.0 CLR).
--
Patrice
.
- References:
- simple example
- From: Tony Johansson
- Re: simple example
- From: Alberto Poblacion
- Re: simple example
- From: Patrice
- Re: simple example
- From: Tony Johansson
- Re: simple example
- From: Patrice
- Re: simple example
- From: Tony Johansson
- Re: simple example
- From: Patrice
- Re: simple example
- From: Patrice
- simple example
- Prev by Date: Re: possible for FileStream lock not released on close ?
- Next by Date: Re: Is user Administrator in c#
- Previous by thread: Re: simple example
- Next by thread: RE: Content file not copied to out folder of a Testrun - FrankMunsber
- Index(es):
Relevant Pages
|