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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgen: fix cross method call + method_call cleanup #20025

Merged
merged 2 commits into from Nov 29, 2023

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Nov 28, 2023

Fix #20012

馃[deprecated] Generated by Copilot at 6243624

This pull request improves the C code generation for method calls in V. It refactors some functions, introduces a new function to resolve the receiver type name, and adds a new test case to cover a previously unhandled scenario. The changes aim to make the code more readable, maintainable, and correct.

馃[deprecated] Generated by Copilot at 6243624

  • Extract resolve_receiver_type function to vlib/v/gen/c/assign.v to get receiver type and symbol from type table (link, link)
  • Move method_call function to vlib/v/gen/c/assign.v to handle method calls in assignments and expressions (link)
  • Add resolve_receiver_name function to vlib/v/gen/c/assign.v to get C name of receiver type for method calls (link)
  • Add test case for cross method calls with maps and move method to vlib/v/tests/cross_method_call_test.v (link)

@felipensp felipensp marked this pull request as ready for review November 28, 2023 17:28
@spytheman spytheman merged commit 883eaa6 into vlang:master Nov 29, 2023
55 checks passed
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.

Cannot swap maps, neither with clone(), nor with move()
2 participants