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

reactive.Effect should warn if function returns a value #425

Open
wch opened this issue Mar 17, 2023 · 0 comments · May be fixed by #427
Open

reactive.Effect should warn if function returns a value #425

wch opened this issue Mar 17, 2023 · 0 comments · May be fixed by #427

Comments

@wch
Copy link
Collaborator

wch commented Mar 17, 2023

For example, if a user writes this:

@reactive.Effect
def foo():
  return 123

It will run and the user will not receive any indication that the code is probably not doing what they expect. (It will be flagged by a static type checker like pyright, but many users don't use them.)

This should raise an informative warning. (And come to think of it, we should do that in R as well. But now that I think about it again, we can't tell in R if a function just returned a value because it happened to be the last expression when running the function, or if the function was really intended to return the value, so we can't add this check in R.)

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 a pull request may close this issue.

1 participant