[Issue 199] Label causes scope to collapse into parent

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 29 11:38:55 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=199



--- Comment #20 from monarchdodra at gmail.com 2013-05-29 11:38:54 PDT ---
(In reply to comment #19)
> (In reply to comment #18)
> > It is still a bug because NoScopeStatement does not mean "expand into 
> > current scope." It means "do not introduce a scope" 
> 
> What is the distinction you are making here?

Well, if it was a "ScopedStatement", it would have meant that:

-----
label: int i; //i is scoped here
i = 5; //Error, i has not been declared
-----

In contrast, with a NoScopedStatement, all it means is that when you write:
-----
label: "{stuff}"
-----
It means that that "{stuff}" itself is not scoped: the "{stuff}" statement can
be seen from the outside. But that doesn't mean the "{stuff}" itself doesn't
create its own internal scope, which contains "stuff", and which can't be seen
from the outside...

That's how I read it now, and the explanation Ali was making.

> > Isn't "code that was broken now generates a compiler error" good though...?
> 
> It is, and that's part of the point I was trying to make.

Ok, cool. Since it was a reply to me, it seemed you were arguing against it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list