Skip to content
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

Short circuited assignment in 'if' expression causes compilation error #17

Open
szabolcsmaj opened this issue Feb 15, 2017 · 0 comments

Comments

@szabolcsmaj
Copy link
Contributor

If a conditional assignment is present in the 'if' expression, GW will generate code that leads to "might not have been initialized" error.

To reproduce:

public void valueAssignmentInIfExpression() {
    int[] a = {1, 2, 3};
    int b, c;
    if ((b = a[0]) == 1 || (c = a[1]) == 3) {
        a = null;
    }
}

In this case, adding the GW.valueChange calls to the 'if' statement body would also lead to the same compilation failure.
The solution for now is to ignore the if statement's conditional part when checking for value change events.

This is no longer a critical issue since the compilation error is fixed. The proper fix depends on #16, without that we cannot add proper value change events. On hold for now.

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

No branches or pull requests

1 participant