mbinge / gomock

Automatically exported from code.google.com/p/gomock
Apache License 2.0
0 stars 0 forks source link

gomock fails to generate functions with closure as arguments #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
gomock will fail on the following interface:

type Bad interface {
    DoSomething(func() string)
}

with the error: "2011/10/09 17:05:54 Can't deduce package for a *ast.FuncType"

It seems like "packagesOfType()" on line 228 cannot handle function types.

Original issue reported on code.google.com by awre...@gmail.com on 9 Oct 2011 at 9:08

GoogleCodeExporter commented 9 years ago
This patch could fix it, but I haven't been able to test it properly yet.

Original comment by awre...@gmail.com on 9 Oct 2011 at 9:22

Attachments:

GoogleCodeExporter commented 9 years ago
That patch is incomplete, and largely my fault for not making it easy to test 
these kinds of changes.

I'll take care of this today.

Original comment by dsymo...@golang.org on 9 Oct 2011 at 9:42

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 5e15eed510d1.

Original comment by dsymo...@golang.org on 9 Oct 2011 at 10:49

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 7988e683d17e.

Original comment by dsymo...@golang.org on 23 Jun 2012 at 5:21