-
Notifications
You must be signed in to change notification settings - Fork 302
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: support inference for calls to generic methods #1075
Comments
Hit this as well. The specific case I ran into was in this form:
|
Thanks for the example! We are working on this. |
FYI, this (or something very similar) came up when Dropwizard upgraded to a new version of Caffeine. Fortunately, in their case, they appear to be better off just removing their usage of |
Heh, this is coming up more with the new release because now our annotations within generics are being noticed more :P. Here's a simpler example:
The best work-arounds I've found so far are:
Just sharing in case it's helpful to anyone else. |
I hope that #1131 will cover many common cases here, but it's a subtle change and we're still working on it. @agrieve once that PR is landed I may ask if you can test on Chromium with a snapshot build. I'm glad to hear that explicit generics have worked for you. That what I would have hoped / expected, though we definitely aim to eliminate the need for these as much as possible. |
Actually, small correction, we will handle the specific case from #1075 (comment) in a follow-up to #1131 |
Ironically due to uber/NullAway#1075 this cannot be null marked. Inferred nullness does not work for generic methods. Bug: 389129271 Change-Id: I95f2099396b4699a2eab5e57f382d0cb98b8f4ed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6437372 Commit-Queue: Calder Kitagawa <[email protected]> Reviewed-by: Andrew Grieve <[email protected]> Auto-Submit: Calder Kitagawa <[email protected]> Cr-Commit-Position: refs/heads/main@{#1443733}
Ironically due to uber/NullAway#1075 this cannot be null marked. Inferred nullness does not work for generic methods. Bug: 389129271 Change-Id: I95f2099396b4699a2eab5e57f382d0cb98b8f4ed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6437372 Commit-Queue: Calder Kitagawa <[email protected]> Reviewed-by: Andrew Grieve <[email protected]> Auto-Submit: Calder Kitagawa <[email protected]> Cr-Commit-Position: refs/heads/main@{#1443733} NOKEYCHECK=True GitOrigin-RevId: 7bfd85ea3768994f3ea270cef10bcfeb7d320789
This will be a significant challenge in general, but maybe we can handle the common cases and do something useful without having a full technique. See here for one test case:
NullAway/nullaway/src/test/java/com/uber/nullaway/jspecify/GenericMethodTests.java
Lines 141 to 160 in 7a3d088
The text was updated successfully, but these errors were encountered: