Error: expression `update` of type `void` does not have a boolean value

Josphe Brigmo JospheBrigmo at gmail.com
Sat Sep 8 03:12:56 UTC 2018


auto foo(bool update = false)()
{
     static if(update)
     { }
}

and the compiler, after upgrading to 2.082 from 2.080 now says:

Error: expression `update` of type `void` does not have a boolean 
value

when update is clearly a bool.

Why the hell is the compiler now thinking update is a void?

1. This code compiles fine in a test app and 2. when I rename 
update to something else it works fine.

2. There is no other use of update in the entire module(not that 
it should matter)

Seems this is a compiler bug but only has a problem in context. 
Remember, it worked find before I updated dmd and there is no 
reason why it shouldn't work.




More information about the Digitalmars-d-learn mailing list