-
Notifications
You must be signed in to change notification settings - Fork 322
Add a case in our inference for generic method calls #1240
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
Conversation
WalkthroughA bug fix was made to the generic type inference logic for method calls in the NullAway static analysis tool, ensuring correct handling when the assignment context type is nullable and the type variable has a nullable upper bound. A new regression test was added to verify this fix for generic methods returning arrays. Changes
Sequence Diagram(s)sequenceDiagram
participant Test as GenericMethodTests.issue1238()
participant Mediator as CreatorMediator
participant Bridge as WebFeedBridge
Test->>Mediator: get(Key<byte[]>)
Mediator-->>Test: byte[]
Test->>Bridge: followFromId(byte[], ...)
Bridge-->>Test: (no error)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes detected. Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (2)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Fixes uber#1238 Before we were missing a fallback case; now we just use the type of the expression computed by `javac` (to be improved in the future). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved handling of nullable type variables in generic methods to ensure correct type inference in assignment contexts. * **Tests** * Added a new test to verify correct behavior when assigning non-nullable arrays to nullable array parameters in generic methods. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Fixes #1238
Before we were missing a fallback case; now we just use the type of the expression computed by
javac(to be improved in the future).Summary by CodeRabbit
Bug Fixes
Tests