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

Dataflow facts from ExpressionStatements #3281

Open
wmdietl opened this issue Apr 30, 2020 · 0 comments
Open

Dataflow facts from ExpressionStatements #3281

wmdietl opened this issue Apr 30, 2020 · 0 comments

Comments

@wmdietl
Copy link
Member

wmdietl commented Apr 30, 2020

Follow-up on #3267 (comment)

I can reproduce your comment about your new typestate checker using the Regex Checker:

    void bar(String s) {
        RegexUtil.isRegex(s);
        if (true) {
            // :: error: (argument.type.incompatible)
            Pattern.compile(s); // Error missing
        }
    }

I'll look into wrapping all ExpressionStatements into an assignment to a temporary variable, turning the above code into:

    void bar(String s) {
        boolean res = RegexUtil.isRegex(s);
        if (true) {
            // :: error: (argument.type.incompatible)
            Pattern.compile(s);
        }
    }

which correctly gives an error.

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