-
Notifications
You must be signed in to change notification settings - Fork 245
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
feat(jsii-go): use reflect to resolve overriden methods #2780
Conversation
The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged. |
//if overriding struct has no overriding methods, could happen if | ||
//overriding methods are not defined with pointer receiver. | ||
if len(mOverrides) == 0 && !strings.HasPrefix(instType.Name(), "jsiiProxy_") { | ||
panic(fmt.Errorf("%s has no overriding methods. Please verify overriding methods are defined with pointer receiver", instType.Name())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
panic(fmt.Errorf("%s has no overriding methods. Please verify overriding methods are defined with pointer receiver", instType.Name())) | |
panic(fmt.Errorf("%s has no overriding methods. Overriding methods must be defined with a pointer receiver", instType.Name())) |
The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged. |
Made some (vey) minor style changes in your code (mostly adding white spaces and capitalisation in comments)... I wonder if the error message you added could be improved a little (but I'm not too concerned about it though). That looks pretty good to me at this stage; it's a very clever idea and I like it. Would you be able to update the documentation under |
Thanks for your comments. I will update the code. It will be great if you could update the docs. Thanks. Just updated the code. |
Updated the docs page now to remove references to the Thank you again for the clever idea & implementation! |
Pull request has been modified.
…clarifies the Windows build failure)
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
Merging (with squash)... |
Pull request has been modified.
@yglcode - don't mind me I'm trying to diagnose the transient windows PR validation failure as it appears to be happening on this particular PR (no idea why or what's wrong 🤷🏻♂️). I'll get your code merged soon (even if I don't manage to understand the failure). |
Merging (with squash)... |
Use reflect to resolve overridden methods, per issue #2768, leveraging
how such methods will no longer be visible on the non-pointer receiver,
while methods promoted from anonymous embeds are.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.