Skip to content

Fix wildcard nullability reasoning for fields and locals #1559

Description

@msridhar

Follow up to #1558. E.g., we should report an error for:

class Test {
  static class Foo<T extends @Nullable Object> {
    T get() { throw new RuntimeException(); }
  }
  static void testNullableExtendsBound(Foo<? extends @Nullable Object> f) {
    Object x = f.get();
    // report error here
    x.hashCode();
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    jspecifyRelated to support for jspecify standard (see jspecify.dev)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions