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

Translation returns the value from the last function even if function returns nothing #15

Closed
tchajed opened this issue Dec 2, 2020 · 1 comment · Fixed by #25
Closed
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@tchajed
Copy link
Collaborator

tchajed commented Dec 2, 2020

In something like

func return3() uint64 {
  return 3
}

func swallowReturnValue() {
  return3()
}

the translation for swallowReturnValue has return3 #() as the last expression (returning 3) when it needs to add ; #() to return the unit value.

@tchajed tchajed added bug Something isn't working good first issue Good for newcomers labels Dec 2, 2020
@tchajed
Copy link
Collaborator Author

tchajed commented Sep 6, 2021

Adding a ; #() to the end of every non-returning function (ideally on every branch rather than outside the entire function) would be an acceptable fix to me even if many translations change. I'd prefer the consistency over really convoluted logic for checking if it is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant