Conversation
Since uber#1654, the executable type used for inference is the method's type as a member of its receiver, and computing it infers the receiver when the receiver is itself a generic call. inferCallType computed it twice for a call not yet inferred (constraints, then return type), and runInferenceForCall a third time for lambda argument types. Inference run from dataflow is never cached, so every generic call in a receiver chain doubled the work below it: checking a fluent chain such as `r.path(..).entity(..).isEqualTo(..)` repeated n times took O(4^n). Compute the executable type once and pass it to runInferenceForCall and generateConstraintsForCall. At 9 links, dataflow inference runs drop from 524,259 to 315; a 96-link chain now checks in under 1s. Assisted-by: Claude Code (claude-opus-5-5)
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: uber/NullAway/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughGeneric-call inference now computes executable types at call sites and reuses them for constraint generation, return-type substitution, and argument mapping. Nested generic calls and generic method-type substitution also pass computed executable types into inference. A new timeout-limited test checks that a 24-segment generic method chain reports a nullable argument at its final Suggested reviewers: Priority: ⬇️ Low Change: Bug fix Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established; this change is ready for normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
msridhar
left a comment
There was a problem hiding this comment.
Thanks for the great fix and the test! I had a feeling I missed some pathological cases like this.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1896 +/- ##
============================================
+ Coverage 87.62% 87.67% +0.05%
Complexity 3499 3499
============================================
Files 110 110
Lines 11642 11641 -1
Branches 2403 2403
============================================
+ Hits 10201 10206 +5
+ Misses 664 657 -7
- Partials 777 778 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@ericschlarmann how critical is this fix for your codebase? Do you need a release soon that includes it? |
Thanks for the quick review and merge! |
Since #1654, the executable type used for inference is the method's type as a member of its receiver, and computing it infers the receiver when the receiver is itself a generic call. inferCallType computed it twice for a call not yet inferred (constraints, then return type), and runInferenceForCall a third time for lambda argument types. Inference run from dataflow is never cached, so every generic call in a receiver chain doubled the work below it: checking a fluent chain such as
r.path(..).entity(..).isEqualTo(..)repeated n times took O(4^n).Compute the executable type once and pass it to runInferenceForCall and generateConstraintsForCall. At 9 links, dataflow inference runs drop from 524,259 to 315; a 96-link chain now checks in under 1s.
Adds GenericMethodTests.longChainOfGenericInstanceMethodCalls, which times out on master and passes in about 0.1s with the fix. No existing test's diagnostics change.
I used Claude Code to bisect the regression to #1654, find the cause and write the fix and test. I have reviewed and understood all the changes.
Assisted-by: Claude Code (claude-opus-5-5)
Summary by CodeRabbit
Bug Fixes
Tests