Skip to content

reflect: TypeOf interface with methods using generic types includes package path in type #55147

@daolis

Description

@daolis

GO Version: 1.19.1

reflect.TypeOf from an interface containing methods using generic types includes the complete package path within the type.

This functionality is use in gomock (reflect mode) and generates not compile-able code.

Example see https://go.dev/play/p/0P8R4Au1Wer

The string representation of the interfaces method type from the playground example looks like the following.
func() test.TestGenericType[play.ground/test.TestType]

Effect in gomock: golang/mock#677

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions