guard clause style static if

kdevel kdevel at vogtner.de
Tue Jul 10 11:52:59 UTC 2018


On Saturday, 7 July 2018 at 13:03:32 UTC, rikki cattermole wrote:
> void func() {
> 	return;
>
> 	func2();
> }
>
> Which is clearly an error. Hence why you need to add else block.

There is no error in this generated code because func2 is 
unreachable. That there is a state/stage during compilation in 
which the call to func2 exists and is checked is an 
implementation detail which IMHO shall not be exposed to the user.


More information about the Digitalmars-d-learn mailing list