static if enhancement

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 24 10:15:51 PDT 2016


On 6/24/16 12:19 PM, Andrei Alexandrescu wrote:
> On 06/24/2016 11:47 AM, Mathias Lang wrote:
>> On Friday, 24 June 2016 at 15:29:18 UTC, Steven Schveighoffer wrote:
>>> On 6/24/16 11:24 AM, Andrei Alexandrescu wrote:
>>>> Does anyone else find this annoying?
>>>> https://issues.dlang.org/show_bug.cgi?id=16201 -- Andrei
>>>
>>> Maybe. That bug report does not identify any problems. What happens
>>> that's currently bad?
>>>
>>
>> Same question: What is the actual problem ?
>> One issue that can arise is
>> https://issues.dlang.org/show_bug.cgi?id=14835 . Is there any other ?
>
> The problem is excessive indentation. -- Andrei

The problem that hasn't been made clear is, why can't you just write:

static if(condition)
{
     ... // some code
     return;
}

// some more code

And the answer is, I'm guessing, bug 14835 -- misguided "unreachable 
statement" warnings.

Should we mark your bug as a duplicate?

-Steve


More information about the Digitalmars-d mailing list