On 11/24/13 6:32 AM, ilya-stromberg wrote:
On Sunday, 24 November 2013 at 14:16:39 UTC, bearophile wrote:
Maxim Fomin:
This is neither bug not a terribale feature.
I think the implicit question of ilya-stromberg was: how much
bug-prone is this language feature?
Yes, exactly. I personally was VERY surprised. My code example from real
life:
class Foo
{
}
class Bar
{
Foo f;
void bar()
{
//variable was wrongly commented here
//bool f = true;
if(f)
{
//Oops!
}
}
}
If uncommented that would make for a shadow definition error. In brief I
think you'll have a hard time finding evidence that "if (p)" is dangerous.
Andrei