facebookincubator / cinder

Cinder is Meta's internal performance-oriented production version of CPython.
https://trycinder.com
Other
3.42k stars 122 forks source link

deltablue: declare dst before while loop #110

Closed bennn closed 1 year ago

bennn commented 1 year ago

Fix a type error

I was running commit fa0ed519af6c131ec141f7bd14ab12a4aa7afc1b

python -m compiler --static deltablue...py gave this error:

....
  File "/vol/Lib/compiler/static/visitor.py", line 44, in visit
    return super().visit(node, *args)
  File "/vol/Lib/compiler/visitor.py", line 70, in visit
    return meth(node, *args)
  File "/vol/Lib/compiler/static/type_binder.py", line 1592, in visitName
    raise TypedSyntaxError(f"Name `{node.id}` is not defined.")
  File "main.py", line 645
    if dst.value != 1170:
      ^
compiler.errors.TypedSyntaxError: Name `dst` is not defined.

All better with this fix.

bennn commented 1 year ago

cc @vivaan2006 who helped discover & fix!

facebook-github-bot commented 1 year ago

@swtaarrs has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 1 year ago

@swtaarrs merged this pull request in facebookincubator/cinder@e54717062f1a0ab5698bd1abc484fb449b759499.