Skip to content

Assignement in condition warning #12250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

RblSb
Copy link
Member

@RblSb RblSb commented Jun 1, 2025

There is also some idea to skip warning when you wrap condition in additional parentheses in first commit.
Related to #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;}) {}

@kLabz
Copy link
Contributor

kLabz commented Jun 1, 2025

That double parenthesis syntax seems out of place :/

@skial skial mentioned this pull request Jun 2, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants