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

refactor(gnolang): handle duplicate method decls using TryDefineMethod #1459

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

thehowl
Copy link
Member

@thehowl thehowl commented Dec 18, 2023

A (IMHO) better method of handling this. Related discussion: #859 (comment)

Avoids creating a panic/recover in Preprocess by handling the "redeclaration" case directly when it happens.

cc/ @jaekwon to confirm whether he agrees it's a good solution.

(suggestion: review with whitespace hidden)

@thehowl thehowl added the 📦 🤖 gnovm Issues or PRs gnovm related label Dec 18, 2023
@thehowl thehowl self-assigned this Dec 18, 2023
@thehowl thehowl requested a review from moul as a code owner December 18, 2023 22:38
Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (8457f7f) 55.87% compared to head (9bb9f43) 55.87%.

Files Patch % Lines
gnovm/pkg/gnolang/types.go 21.05% 15 Missing ⚠️
gnovm/pkg/gnolang/preprocess.go 14.28% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1459      +/-   ##
==========================================
- Coverage   55.87%   55.87%   -0.01%     
==========================================
  Files         430      430              
  Lines       65618    65607      -11     
==========================================
- Hits        36667    36655      -12     
- Misses      26083    26084       +1     
  Partials     2868     2868              
Flag Coverage Δ
go-1.21.x ∅ <ø> (∅)
misc ∅ <ø> (∅)
misc-_test.genstd ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@thehowl thehowl mentioned this pull request Dec 19, 2023
8 tasks
Copy link
Contributor

@jaekwon jaekwon left a comment

Choose a reason for hiding this comment

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

looks good, if all this is doing is turning a panic into a boolean return.

Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

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

Very clean 💯

@thehowl thehowl merged commit c6097cd into master Jan 8, 2024
187 of 188 checks passed
@thehowl thehowl deleted the dev/morgan/native-bindings-refac-panic branch January 8, 2024 18:18
gfanton pushed a commit to moul/gno that referenced this pull request Jan 18, 2024
gnolang#1459)

A (IMHO) better method of handling this. Related discussion:
gnolang#859 (comment)

Avoids creating a panic/recover in Preprocess by handling the
"redeclaration" case directly when it happens.

cc/ @jaekwon to confirm whether he agrees it's a good solution.

(suggestion: review with whitespace hidden)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants