haxe
haxe copied to clipboard
Assignement in condition warning
There is also some idea to skip warning when you wrap condition in additional parentheses in first commit. Related to https://github.com/HaxeFoundation/haxe/issues/8634
var foo = false;
var foo2 = false;
// warning for these cases
var value = (foo = foo2) ? true : false;
if (foo = true) {}
if (foo = null) {}
if ({123; foo = true;}) {}
while (foo = true) {}
do {} while (foo = true);
var dyn:Dynamic = false;
if (dyn = null) {}
if (dyn = false) {}
if ((foo = null) && (foo = true)) {}
if ((foo = null) && ((foo = true) && (foo = true))) {}
// no warning
if ({foo = true; true;}) {}