Java: Add TypeFlow base case for partially unbound types.#21149
Java: Add TypeFlow base case for partially unbound types.#21149aschackmull merged 2 commits intogithub:mainfrom
Conversation
|
Dca is uneventful. I also did a MRVA top 1000 check focused mainly on risk reduction to measure tuples calculated in TypeFlow - only one repo went up with more than 10% (and not much more than that), so this change seems quite safe and fairly corner-case, but certainly worth it to shore up the identified hole. |
There was a problem hiding this comment.
Pull request overview
This PR extends TypeFlow base cases to handle transitions from instantiated to partially unbound parameterized types. Previously, only transitions to fully unbound types were covered. This enhancement addresses issue #21066 by capturing type information loss when individual type arguments become uninstantiated.
Changes:
- Added
partiallyUnboundpredicate to detect parameterized types with unrestricted type arguments at specific positions - Extended the
upcastpredicate with a new base case for partially unbound type transitions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hvitved
left a comment
There was a problem hiding this comment.
LGTM, but I guess it would be nice with a test case.
Done! |
Base cases for TypeFlow are the places where we lose type information in a way that can affect dispatch. Stepping from an instantiated parameterised type to a fully unbound type was already covered. This PR extends this to also include the case when just 1 type argument goes from instantiated to un-instantiated.
This solves the provided example in #21066