Skip to content

Compute upper bounds of wildcards more correctly #1576

Description

@msridhar

If I have a wildcard ? extends Foo passed to a type variable T extends Bar, the "effective" upper bound of the wildcard is the greatest-lower bound (GLB) of Foo and Bar (see JLS 5.1.10). Right now, our JSpecify wildcards code (the wildcardUpperBound method) just looks at the explicit Foo upper bound in this case; it should compute the GLB instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions