-
Notifications
You must be signed in to change notification settings - Fork 373
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
feat(gnovm): sync code AssignStmt - ValueDecl #3017
base: master
Are you sure you want to change the base?
feat(gnovm): sync code AssignStmt - ValueDecl #3017
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3017 +/- ##
==========================================
- Coverage 63.32% 63.31% -0.01%
==========================================
Files 548 548
Lines 78511 78480 -31
==========================================
- Hits 49719 49692 -27
+ Misses 25438 25434 -4
Partials 3354 3354
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🔥
Co-authored-by: Mikael VALLENET <[email protected]>
gnovm/pkg/gnolang/preprocess.go
Outdated
nx.Path = last.GetPathForName(nil, nx.Name) | ||
} | ||
} | ||
if len(n.Values) != 1 && len(n.Values) != 0 && len(n.NameExprs) != len(n.Values) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this len(n.Values) != 1 && len(n.Values) != 0
?
I think this will not handle this case:
package main
var a, b = 1
func main() {
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally, there were 3 cases:
if numNames > 1 && len(n.Values) == 1 {
...
} else if len(n.Values) != 0 && numNames != len(n.Values) {
...
} else {
...
}
To be able to refactor the code, I've moved this check first then 2 others. So I've added the condition but it looks strange like that, I've pushed the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@omarsy I've checked, actually the errors for var a, b = 1 vs a, b := 1 are identical with Golang
This PR aims at fixing this issue 1958
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description