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
When using go toolchain 1.23.0 and go version 1.23, interfaces with methods that has an aliased type as an argument will fail to generate with the following error
[debug] loadPackages took 32.180249ms
[debug] resolvePackagePath took 11.411105ms
Error: generating circuit wrapper: resolvePkgPaths: invalid type: <module>/api.TestAlias
(The file was not in the module root, but in the /api folder, so I would have expected the path to be <module>/api/api.TestAlias)
This is the smallest example I could create, and produced the above error.
Command used to generate: go run github.com/twitchtv/circuitgen --name TestInterface --pkg ./ --debug --out ./circuit.gen.go --alias TestCircuit --circuit-major-version 3
The text was updated successfully, but these errors were encountered:
By default, go/types now produces Alias type nodes for type aliases
I was able to resolve this by adding case *types.Alias: to resolvePkgPaths' breakout cases locally. It should also be temporarily resolvable by setting GODEBUG=gotypesalias=0
I attempted to do the quick fix I mentioned, but testing was not running due to errorcheck panic-ing. Even bypassing it, I was running into other issues getting the generation to properly execute. I think there are deeper issues around the more modern versions of go.
When using go toolchain 1.23.0 and go version 1.23, interfaces with methods that has an aliased type as an argument will fail to generate with the following error
(The file was not in the module root, but in the /api folder, so I would have expected the path to be
<module>/api/api.TestAlias
)This is the smallest example I could create, and produced the above error.
Command used to generate:
go run github.com/twitchtv/circuitgen --name TestInterface --pkg ./ --debug --out ./circuit.gen.go --alias TestCircuit --circuit-major-version 3
The text was updated successfully, but these errors were encountered: