You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This appears to only affect reflect mode. Source mode works correctly. It may be that this bug exists because type aliases are not available through reflection. If that is the case, feel free to close.
Actual behavior
Consider these files:
// In foo/foo.gopackage foo
import"github.com/atombender/gomock-issue/foo/internal/things"typeThing= things.Thing
// In foo/internal/things/things.gopackage things
typeThingstruct{}
// In bar/bar.gopackage bar
import"github.com/atombender/gomock-issue/foo"typeStarterinterface {
Start(thing*foo.Thing)
}
This is a real problem since the things package is internal, e.g. internal/things.go, relative to foo, which is in an adjacent package. This means the compilation fails:
package github.com/atombender/gomock-issue/bar/mocks
bar/mocks/mocks.go:15:2: use of internal package github.com/atombender/gomock-issue/foo/internal/things not allowed
Expected behavior
The generated mock should actually refer to the original type:
This appears to only affect reflect mode. Source mode works correctly. It may be that this bug exists because type aliases are not available through reflection. If that is the case, feel free to close.
Actual behavior
Consider these files:
The generated mock will look like this:
This is a real problem since the
things
package is internal, e.g.internal/things.go
, relative tofoo
, which is in an adjacent package. This means the compilation fails:Expected behavior
The generated mock should actually refer to the original type:
To Reproduce
Repository with full repro. Test with:
Additional Information
The text was updated successfully, but these errors were encountered: