Consider the following code sample:
// line #
{ // 1
// 2
{ // 3
double test = 0; // 4
} // 5
// 6
double test = 0; // 7
} // 8
This gives the error
A local variable named 'test' cannot be declared in this scope because it would give a different meaning to 'test', which is already used in a 'child' scope to denote something else
But I don't understand why? The outer test variable starts in line 7 and not in line 2, so where's the problem to declare a second variable called test on line 4 with a scope ending on line 5?