-
Notifications
You must be signed in to change notification settings - Fork 284
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
Add support for switch expressions #518
Conversation
jdk17-unit-tests/build.gradle
Outdated
} | ||
|
||
coverallsJacoco { | ||
reportPath = "jdk17-unit-tests/build/reports/jacoco/test/jacocoTestReport.xml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an issue of separate coverage files for these tests and the main NullAway tests, so Coveralls may complain. A possible solution is here: https://discuss.gradle.org/t/merge-jacoco-coverage-reports-for-multiproject-setups/12100/6 I propose we go ahead with landing this PR and solve the coverage issue in a follow-up
ExpressionTree switchExpression = tree.getExpression(); | ||
if (switchExpression instanceof ParenthesizedTree) { | ||
switchExpression = ((ParenthesizedTree) switchExpression).getExpression(); | ||
ExpressionTree switchSelectorExpression = tree.getExpression(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a variable rename (to avoid confusion with switch expressions) and also a comment to explain why parens are being removed
Working on trying to aggregate coverage, switching to draft for now |
Closing since Coveralls only works when the PR is from a branch on the origin repo |
Fixes #289
Checker Framework 3.21.0 added support for switch expressions; we build on that to support the expressions in NullAway. We also add a
jdk17-unit-tests
module to test the support (which requires a JDK 12+ compiler).