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

cgen: fix codegen for return on last statement of return IfExpr #23551

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

felipensp
Copy link
Member

Fix #23550

Copy link

Connected to Huly®: V_0.6-21979

@felipensp felipensp changed the title cgen: fix multi return on if expr cgen: fix codegen for return on last statement of return IfExpr Jan 22, 2025
@JalonSolov
Copy link
Contributor

So you're just making sure the return is output, rather than warning/error?

@felipensp
Copy link
Member Author

So you're just making sure the return is output, rather than warning/error?

Yes. Just like we do in return match foo { a { return expr } else { ... } }

@JalonSolov
Copy link
Contributor

I think that's a mistake as well. A return inside a return makes no sense.

@felipensp felipensp marked this pull request as ready for review January 22, 2025 20:10
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.

return if statement broken returning optional multiple values.
2 participants