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

Return type isn't always properly checked #497

Closed
cburgdorf opened this issue Aug 4, 2021 · 0 comments
Closed

Return type isn't always properly checked #497

cburgdorf opened this issue Aug 4, 2021 · 0 comments

Comments

@cburgdorf
Copy link
Collaborator

What is wrong?

We should expect the following to fail because the function will implicitly return () but its signature says it returns bool. It currently compiles but it shouldn't.

contract Foo:

  def bar() -> bool:
    if 1 == 2:
      return true

How can it be fixed

The analyzer needs to reject this with a proper user error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant