Skip to content

go/types, types2: record instantiated type when fully instantiated function call is missing arguments #52503

Open
@findleyr

Description

@findleyr

Raised in CL 394017 by @muirdm, the type checker is recording the generic type for a called function if arguments are missing, even if all necessary type arguments are provided, as in the following:

func foo[A int|string](a A) {}

foo[int]() // recorded function type is still func[A int|string](A), even though it should be known to be func(int)

Example: https://go.dev/play/p/xBmccoNdCK_Y

This is probably a low priority (hence not adding the 1.19 milestone), but it would be nice to clean this up as we work on improved type inference.

CC @griesemer

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions