golang/mock

[mockgen] Errors creating mocks for embedded generic interfaces

kevinconaway opened this issue · 1 comments

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

I believe this is a dupe of #643.