static if else behavior and is type comparison

Chris Wright via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Mar 11 10:07:54 PST 2016


On Fri, 11 Mar 2016 00:21:33 -0800, Ali Çehreli wrote:

> You've been bitten by a common usability issue. :)
> 
> On 03/11/2016 12:02 AM, Fynn Schröder wrote:
>  >      static if (is(U == ubyte)) {
>  >          pragma(msg, "is ubyte");
>  >          return fnUbyte();
>  >      } else if (is(U == ushort)) {
> 
> You mean 'else static if'. (Not your fault: I (and others) wish the
> compiler warned about this problem.)
> 
> Ali

https://github.com/Hackerpilot/Dscanner/pull/309

Turns out it's much faster to change a lint tool than to change the 
compiler.


More information about the Digitalmars-d-learn mailing list