http://d.puremagic.com/issues/show_bug.cgi?id=10638
bearophile_h...@eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_h...@eml.cc --- Comment #2 from bearophile_h...@eml.cc 2013-07-14 04:58:13 PDT --- (In reply to comment #1) > I believe the primary reason is to prevent bugs where == was meant and not =. > Usually, what you want to do is: > > void main() > { > int i = f(); > if (i == 1) > { > //...... > } > } Right. D is working as designed here, it helps avoid bugs. > Also dlang.org defines ifStatement as "if ( IfCondition ) ThenStatement", > where ifCondition can be Expression (hence AssignExpression too), > but it seems it does not work at practice. Then maybe that's what needs fixing. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------