Errors in TDPL

Walter Bright newshound2 at digitalmars.com
Tue Jun 22 06:53:05 PDT 2010


biozic wrote:
> Le 22/06/10 10:54, Walter Bright a écrit :
>> Andrei Alexandrescu wrote:
>>> On 06/21/2010 08:47 PM, Jonathan M Davis wrote:
>>>> On page 82 of TDPL, it's talking about try/catch/finally statements,
>>>> and it
>>>> says that "all controlled statement must be block statements; that is
>>>> they
>>>> must be enclosed with braces." However, dmd does not seem to require
>>>> that
>>>> try/catch/finally blocks have braces, which is what I would expect that
>>>> sentence to mean. C++ has that restriction for reasons that I don't
>>>> understand, but as far as I can tell, D does not - certainly dmd 
>>>> doesn't
>>>> appear to require it. Is the statement correct but refers to
>>>> something else,
>>>> or is it in error?
>>>>
>>>> - Jonathan M Davis
>>>
>>> That's a surprise to me. Walter, is that intentional?
>>
>> They do not require braces, they just require that the controlling
>> statement not be a single ;. In the grammar, this is a ScopeStatement,
>> which is a NonEmptyStatement or a BlockStatement.
>>
>>
>> http://www.digitalmars.com/d/2.0/statement.html#ScopeStatement
> 
> Not always: http://d.puremagic.com/issues/show_bug.cgi?id=4024

Bugs in the compiler aren't errors in TDPL!


More information about the Digitalmars-d mailing list