-
Notifications
You must be signed in to change notification settings - Fork 288
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
JSpecify: Handle @Nullable elements for enhanced-for-loops on arrays #986
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #986 +/- ##
=========================================
Coverage 85.94% 85.95%
- Complexity 2069 2070 +1
=========================================
Files 83 83
Lines 6860 6863 +3
Branches 1318 1319 +1
=========================================
+ Hits 5896 5899 +3
Misses 550 550
Partials 414 414 ☔ View full report in Codecov by Sentry. |
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.
Overall LGTM! Just a couple of minor comments
@@ -507,7 +508,6 @@ public TransferResult<Nullness, NullnessStore> visitAssignment( | |||
Node rhs = node.getExpression(); | |||
Nullness value = values(input).valueOfSubNode(rhs); | |||
Node target = node.getTarget(); | |||
|
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.
remove this whitespace change
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.
Fixed
nullaway/src/main/java/com/uber/nullaway/dataflow/AccessPathNullnessPropagation.java
Show resolved
Hide resolved
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.
Thanks!
Currently, enhanced-for-loops do not honor nullability annotations on arrays.
Current Behavior
Both these dereferences work fine.
New Behavior
The first one throws an error, as expected.
Fixes #983