Yes, it is a well known behaviour not intended as a feature, that someone uses as if it were reliable semantic: although it is to be noted that even if it's not strictly a bug, such behaviour is not reliable and is left undefined by the specs (as of the docs). So it's better not to use it, period.
Logically, it doesn't make much sense at all to want have a declaration depending on a modifier: would you really like to have a lexical variable exist or not depending on a condition in the surrounding lexical scope?!?