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

[ruby] Bind nested method members to method type #4747

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

DavidBakerEffendi
Copy link
Collaborator

This PR fixes a bug where method members were not correctly linked to surrounding methods' bound type decls. Additionally, this handles return statements without any proceeding expression.

Resolves #4732

This PR fixes a bug where method members were not correctly linked to surrounding methods' bound type decls. Additionally, this handles `return` statements without any proceeding expression.

Resolves #4732
@DavidBakerEffendi DavidBakerEffendi added the ruby Relates to rubysrc2cpg label Jul 8, 2024
@DavidBakerEffendi DavidBakerEffendi self-assigned this Jul 8, 2024
Copy link
Contributor

@AndreiDreyer AndreiDreyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a test to confirm the return expression is handled correctly without any proceeding expressions, or is that covered with the implicit return generated for the function in the new test?

@DavidBakerEffendi
Copy link
Collaborator Author

@AndreiDreyer we probably should. I originally found the bug in an "unless" expression which puts the return in an expression position instead of a statement one.

Will do that in a sec.

@DavidBakerEffendi DavidBakerEffendi merged commit 0acd0a2 into master Jul 8, 2024
5 checks passed
@DavidBakerEffendi DavidBakerEffendi deleted the dave/ruby/nested-method-member-binding branch July 8, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Relates to rubysrc2cpg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]Fail to get CPG for Ruby
2 participants