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

implement naked returns #189

Merged
merged 2 commits into from
Jan 7, 2018
Merged

Conversation

sbinet
Copy link
Collaborator

@sbinet sbinet commented Jan 6, 2018

Fixes #188.

@sbinet sbinet requested a review from crawshaw January 6, 2018 12:12
@codecov-io
Copy link

codecov-io commented Jan 6, 2018

Codecov Report

Merging #189 into master will decrease coverage by 0.01%.
The diff coverage is 28.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
- Coverage   50.54%   50.53%   -0.02%     
==========================================
  Files          22       22              
  Lines       10016    10025       +9     
==========================================
+ Hits         5063     5066       +3     
- Misses       4452     4458       +6     
  Partials      501      501
Impacted Files Coverage Δ
typecheck/typecheck.go 22.4% <28.57%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cce5c9e...a51db59. Read the comment docs.

Copy link
Member

@crawshaw crawshaw left a comment

Choose a reason for hiding this comment

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

It looks like you're building and passing the retNames slice and then only using the fact that it's non-zero in length. Do you have a use for the names later?

If not, it may be worth simplifying the object. Maybe:

type returnType struct {
retType *tipe.Tuple
isNamed bool
}

@sbinet
Copy link
Collaborator Author

sbinet commented Jan 7, 2018

I started with only passing the len of the slice, but for detecting when there is shadowing, I'll probably need to get the names of the variable too.

@crawshaw
Copy link
Member

crawshaw commented Jan 7, 2018

OK, sounds good.

@sbinet sbinet merged commit 527d9d3 into neugram:master Jan 7, 2018
@sbinet sbinet deleted the naked-returns branch January 7, 2018 17: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.

None yet

3 participants