Re: c# v3.0: implicit variable declaration, why?
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Tue, 19 Sep 2006 19:23:35 +0100
Brian Gideon <briangideon@xxxxxxxxx> wrote:
That's quite tricky in the case where you're using anonymous types as
provided by LINQ: an explicit declaration is *impossible* in that case.
I personally think that having anonymous types is worth the potential
problems of "var", although I would imagine that there'll be a lot of
code checkers which make sure you don't use it where you don't need
to...
I wonder if a compiler warning could be added for the trivial misuse of
the var declaration. I'm not sure how feasible it would be...I'm just
thinking out loud right now.
I'd been wondering the same thing, to be honest...
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- References:
- c# v3.0: implicit variable declaration, why?
- From: Nathan Laff
- Re: c# v3.0: implicit variable declaration, why?
- From: Nicholas Paldino [.NET/C# MVP]
- Re: c# v3.0: implicit variable declaration, why?
- From: Scott M.
- Re: c# v3.0: implicit variable declaration, why?
- From: Bruce Wood
- Re: c# v3.0: implicit variable declaration, why?
- From: Scott M.
- Re: c# v3.0: implicit variable declaration, why?
- From: Jon Skeet [C# MVP]
- Re: c# v3.0: implicit variable declaration, why?
- From: Brian Gideon
- c# v3.0: implicit variable declaration, why?
- Prev by Date: Re: Building .tbl
- Next by Date: Re: Check permissions on Folder
- Previous by thread: Re: c# v3.0: implicit variable declaration, why?
- Next by thread: Re: c# v3.0: implicit variable declaration, why?
- Index(es):