Skip to content
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

Handle generic params and return types #258

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

Ralph7C2
Copy link
Contributor

This only covers the case where the interface itself isn't generic but accepts or returns a generic with a concrete type arg.

Currently, the fake fails to import the package for the type arg. Now, while creating imports, we iterate over TypeArgs for named types and import the packages for them.

This only covers the case where the interface itself isn't generic, but
accepts or returns a generic with a concret type parameter.

Currently, the fake fails to import the package for the type arg. Now
while creating imports we iterate over TypeArgs for named types and
import the packages for them.
@joefitzgerald
Copy link
Collaborator

Thanks for this! I will take a detailed look in the next day, but at first glance it looks great 🙏

@Ralph7C2
Copy link
Contributor Author

Hey @joefitzgerald I'd like to resurrect this if I could, I just bumped into this problem again. https://goplay.tools/snippet/cRLlU7yek6Q is a summary

The problem could also be fixed if concrete types fulfilled interfaces with interfaces int heir methods (a mouthful, I know). But, that seems less likely and I think this patch would fix the issue for me(allowing to generate a fake for the specified generic in an interface)

@joefitzgerald
Copy link
Collaborator

Hey @Ralph7C2 sorry for the delay. Looking at this now.

@zachgersh
Copy link

Hey @joefitzgerald (hope you are doing well, long time no speak since our pivotal days). I hate to be that person but I also need this as well 👯

Hope you have some time to merge this, we using a work around for now!

@joefitzgerald joefitzgerald merged commit 2c17700 into maxbrunsfeld:main Jan 12, 2024
3 checks passed
@joefitzgerald
Copy link
Collaborator

@Ralph7C2, sorry for the lengthy delay in getting this merged (work got a little crazy). Thanks for the contribution!

Hi @zachgersh! It's great to hear from you!! You can always feel free to be that person 😄 ❤️.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants