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

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

Closed
kevinconaway opened this issue Aug 3, 2022 · 1 comment · Fixed by uber-go/mock#13
Closed

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

kevinconaway opened this issue Aug 3, 2022 · 1 comment · Fixed by uber-go/mock#13

Comments

@kevinconaway
Copy link

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

@codyoss
Copy link
Member

codyoss commented Aug 11, 2022

I believe this is a dupe of #643.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants