Skip to content

Enhance generic method inference to compute mappings from type variables to full types? #1585

Description

@msridhar

Right now, our generic method inference computes only the top-level nullability for each type variable of a generic method. Our assumption was that we could rely on javac to correctly compute the type arguments otherwise. But, as #1473 and #1574 show, sometimes this is not the case, and it makes sense: computing the nullability-enhanced type of an actual parameter (particularly for its type arguments) requires extra logic that javac doesn't include. While our hacks seem to hold up for now, eventually, we probably want to enhance generic method inference to compute full mappings from type variables to (nullability-enhanced) types to fix this properly, relying on javac types where appropriate but not always. This could be fixed alongside #1291 which will also require a re-working of inference.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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