-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate if we can use GODEBUG=gotypealias=1
to get around type alias sadness
#763
Comments
I dived into seeing if this is feasible, but it appears not. The |
Some additional clarity on where this issue lies. I discovered the
This is just further proof that we cannot do anything further until the Go devs update the compiler export format and importers. |
replace-types
was added because the Go AST does not have any nodes for type alias, thus the alias gets resolved to its underlying type. Go 1.22 adds a debug feature calledgotypealias
that seems to provide an explicit node for type aliases. This would potentially allow us to handle aliases automatically and not have it resolved to the real type.The way to do this would be to modify
.mockery.yaml
to generate mocks for a type alias that points to an internal package, setGODEBUG=gotypealias=1
, and see what happens. If it works then we can just update the docs to let people know.#725 (comment)
#540 (comment)
The text was updated successfully, but these errors were encountered: