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

compiler: Initialize named returns to default values #3401

Merged

Conversation

fyfyrchik
Copy link
Contributor

Make them behave as locals. We must initialize them before the function because the default value could also be used inside the function body.

Make them behave as locals. We must initialize them at the start
because the default value could also be used inside the function body.

Signed-off-by: Evgenii Stratonikov <[email protected]>
@fyfyrchik
Copy link
Contributor Author

fyfyrchik commented Apr 4, 2024

There is a comment about named returns in defer handling -- it is unrelated and has a different root cause.

@roman-khimov roman-khimov added this to the v0.106.0 milestone Apr 4, 2024
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.84%. Comparing base (f2bb4d4) to head (78cefca).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3401      +/-   ##
==========================================
+ Coverage   84.81%   84.84%   +0.02%     
==========================================
  Files         331      331              
  Lines       44972    44983      +11     
==========================================
+ Hits        38145    38167      +22     
+ Misses       5318     5298      -20     
- Partials     1509     1518       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@roman-khimov roman-khimov merged commit cf49e8c into nspcc-dev:master Apr 5, 2024
20 checks passed
@fyfyrchik fyfyrchik deleted the compiler-named-return-defaults branch April 5, 2024 13:34
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.

3 participants