Should this be flagged as a warning?

Bernard Helyer b.helyer at gmail.com
Tue Sep 25 12:30:12 PDT 2012


I tried to post this last night, but the NG wasn't having any of 
it.

I found myself writing a bug that looked like this

     match(ts, TokenType.Is);
     match(ts, TokenType.OpenParen);
     isExp.type == parseType(ts);

The bug being of course, that a type is parsed and ts is modified,
so the expression has side effects so it's not flagged as a 
useless
expression. But the comparison still has no effect, so should 
this be
flagged by DMD?

-Bernard.


More information about the Digitalmars-d mailing list