Skip to content
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

Open
msridhar opened this issue Nov 14, 2024 · 2 comments
Open

JSpecify: support inference for calls to generic methods #1075

msridhar opened this issue Nov 14, 2024 · 2 comments
Labels
jspecify Related to support for jspecify standard (see jspecify.dev)

Comments

@msridhar
Copy link
Collaborator

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:

public void genericMethodAndVoidTypeWithInference() {

@msridhar msridhar added the jspecify Related to support for jspecify standard (see jspecify.dev) label Nov 14, 2024
@agrieve
Copy link

agrieve commented Jan 8, 2025

Hit this as well.

The specific case I ran into was in this form:

@NullMarked
public class Foo {
  public static class Key<T extends @Nullable Object> {}

  private static final Key<@Nullable Foo> KEY = new Key();

  public static <T extends @Nullable Object> void setValue(Key<T> key, T value) {
  }

  public static void main() {
    setValue(KEY, null);
  }
}

@msridhar
Copy link
Collaborator Author

msridhar commented Jan 8, 2025

Thanks for the example! We are working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jspecify Related to support for jspecify standard (see jspecify.dev)
Projects
None yet
Development

No branches or pull requests

2 participants