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

fannkuch benchmark & implicit returns #115

Open
bennn opened this issue Jun 15, 2023 · 0 comments
Open

fannkuch benchmark & implicit returns #115

bennn opened this issue Jun 15, 2023 · 0 comments

Comments

@bennn
Copy link
Contributor

bennn commented Jun 15, 2023

On Cinder 3.10, fannkuch_static_basic_lib.py gives a type error about implicitly returning None:

 File "fannkuch_static_basic_lib.py", line 15
    def fannkuch(n: int) -> int:
compiler.errors.TypedSyntaxError: Function has declared return type 'int' but can implicitly return None.

Here's a small program with the same error:

def main()->int:
  while 1:
    if 0:
      pass
    else:
      return 4

main()

A quick fix is to add return 0 or something to the bottom of fannkuch. But maybe the implicit return analysis needs an upgrade.

cc @vivaan2006 who helped discover this

bennn added a commit to utahplt/static-python-perf that referenced this issue Jul 21, 2023
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

No branches or pull requests

1 participant