Skip to content

Compound assignment operators perform plain assignment #65

Description

@mattcce

Description

Compound assignment operators (e.g. +=, -=) appear to get parsed as plain assignment operators.

Reproduction

This program:

class A {
    public static void main(String[] args) {
        int x = 0;
        x -= 1;
        x += 1;
    }
}

in the CSE machine results in x being set to 1 twice instead of -1, then 0 as expected. The final value of x is 1.

Activity

  1. kjw142857 commented on Sep 30, 2026

    @kjw142857
    Contributor

    Bug fixed in the main evaluator path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions