Skip to content

IDE to Issue a Warning when Assignment Is Used Instead of Equality Comparison Operator when It's "Not Supposed to" Be Used #113

@Aks0121

Description

@Aks0121

Is your feature request related to a problem? Please describe.
In my experience (and, as I gather, from the experiences of many), I've found that I spend hours trying to debug a script when I had apparently used an assignment operator instead of an equality comparison operator—with the lack of the extra '=' managing to evade me for a long time.

Describe the solution you'd like
When using an 'if statement' or a 'while loop' or any similar setup—where the assignment operator is apparently not used as widely as part of the conditions for those statements—the IDE would issue a warning if an assignment operator is used instead of an equality comparison operator.

For example,

if (someVariable = someValue){ }

would result in a warning that says (along the lines of) "are you sure you meant to use an assignment operator here"?

If I'm not mistaken, PyCharm already does this for Python.

Thank you for reading this!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions