-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
[WIP] allow imported constraints for generics #198
Conversation
@cbaker (and whoever else comes across this) I just built from your fork and it does not appear to fix #177 sadly. I brought over the failing test from PR #190, fixed up the golden file and confirmed it does not generate the imported generic's package when generating the code. I built from your branch and sanity checked on my production use case and sadly confirmed it there as well. Haven't dug into it yet to try and fix it but I really need to understand it so I can try and get it sorted out. It's causing a headache and ugly workarounds that I want to stop from growing. |
Did you use the branch on my fork for this PR or main? This isn't merged into main on my fork yet. |
I think I see the problem. You're using a struct instead of an interface, hopefully simple to remedy, I'll check it out later tomorrow. Thanks. |
@TheFellow I have replicated the issue and began working a solution, just have not had a crazy amount of time recently. |
Thanks,
But I am not sure if this covers all issues mentioned in this thread.
I am off work now, so I can check tomorrow.
Cheers,
β¦On Tue, Jun 20, 2023, 17:14 Chad ***@***.***> wrote:
Believe this will address: #177
<#177> #190
<#190>
Maybe: #173 <#173> ? Seems kinda
"generic" ha
I just opened PR #199 <#199> which
fixes #177 <#177>, might be relevant
here.
I believe what you did will more than likely fix it for everyone in a way
more eloquent manner. Great job.
β
Reply to this email directly, view it on GitHub
<#198 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWX4MRRQ77R2D7HNFW4H33XMG45XANCNFSM6AAAAAAYHFEIJU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'm not the most knowledgeable on the STDLIB given it's pretty big but this seems to work relatively well. π€·ββοΈ
If there is a way to accomplish the helper functions more optimally, I'd love to know. Thanks!
Example of the problem:
If we try to put this into mock as it stands it will attempt to generate something like:
This is a problem and causes moq to fail in 2 ways:
The solution I have presented will add "os/fs" to the imports on the mock and generate: