[Issue 199] Label causes scope to collapse into parent

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 29 08:01:43 PDT 2013


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



--- Comment #17 from Stewart Gordon <smjg at iname.com> 2013-05-29 08:01:42 PDT ---
(In reply to comment #10)
> According to this talk:
> http://forum.dlang.org/thread/ohctkdnupmbprglobwtc@forum.dlang.org#post-axonofactkyzpagilcbm:40forum.dlang.org
> The spec does NOT state it should work that way.

Yes it does, as I quoted in comment 5.

LabeledStatement:
    Identifier : NoScopeStatement

But since
- it's arbitrary
- it's counter-intuitive
- I can't see how any code can take advantage of this "feature"
I agree in principle that it should be changed to simply

LabeledStatement:
    Identifier : Statement

While this would change the behaviour of code such as that in comment 13, ISTM
far more likely that anybody who seriously writes such code is unfamiliar with
this arcane detail of the D spec.

(In reply to comment #16)
> (In reply to comment #15)
>> Walter Bright, comment #6:
>>> I don't want to change this because it could break existing code
>> 
>> We could deprecate having a BlockStatement after a label, with a message
>> suggesting to move the label within the block. That way no code gets broken.
> Wait. What? Deprecate having a block statement after a label? Why would we do
> that? That's completely arbitrary. Plus, that would *definitely* break more
> code than what we'd break with a straight up fix.

My inkling is that, compared with the amount of code it would break, it would
cause far more code that was already broken to generate a compiler error.

-- 
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