Superfluous code in switch statement

Paul via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Sep 5 00:46:08 PDT 2015


On Friday, 4 September 2015 at 21:20:11 UTC, Timon Gehr wrote:
> On 09/04/2015 11:12 PM, anonymous wrote:
>> On Friday 04 September 2015 23:04, Timon Gehr wrote:
>>
>>> DMD never warns about dead code.
>>
>> It warns here:
>>
>> ----
>> import std.stdio;
>> void main()
>> {
>>      return;
>>      writeln("hi"); /* Warning: statement is not reachable */
>> }
>> ----
>>
>
> You are right, it does. Then I suppose there is no reason why 
> it shouldn't warn in the switch case.

I see, thanks.


More information about the Digitalmars-d-learn mailing list