Skip to content

Compound assignment operators perform plain assignment #65

Open
@mattcce

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.

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