Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

[mockgen] Errors creating mocks for embedded generic interfaces #668

@kevinconaway

Description

@kevinconaway

I installed commit 73266f9366fcf2ccef0b880618e5a9266e4136f4 and attempted to generate mocks for an interface that uses both generics and embedded interfaces.

Below is an example:

type Foo[V any] interface {
	Method() V
}

type Bar[V any] interface {
	Foo[V]
	NewMethod() V
}
$ mockgen -source=input.go -destination=input_mockgen.go
2022/08/02 21:35:00 Loading input failed: don't know how to mock method of type *ast.IndexExpr

If I remove the interface embed from Bar the mocks will be generated.

Additional Information

  • gomock mode (reflect or source): source
  • gomock version or git ref: 73266f9
  • golang version: 1.18.1

Triage Notes for the Maintainers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions