I get the error :
A local variable named 's' cannot be declared in this scope because it would give a different meaning to 's', which is already used in a 'child' scope to denote something else.
static void Main(string[] args)
{
string s = "hello"; // Line 1
var test = new[] { "abd", "def" }.Select(s => s.StartsWith("a")); // Line 2
}
Why?
I would have guessed that the 's' from line 1 would be shaded by the '.Select(s =>..' decleration in line 2 but - as far as I can tell - this is not the case..
PS I'm not sure that shaded it the proper term - please correct me if a better word/phrase exsists.