Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

nonsensical TypeError from "-X jit -m compile --static"

Open
#86 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
compilers

Research direction

Start with cinder_typed_prim_bug.py and reproduce the failure using the Docker command with -X jit -m compiler --static. Trace the compiler path from compiler/main.py for calls using static.double primitives and compare it with the working command. Done means the example runs successfully and prints the expected result without the TypeError.

Written by the indexing model from the issue text.

Description

sp-correctness staticpython

good (no options):

$ docker run -v $PWD:/vol -it --rm ghcr.io/facebookincubator/cinder-runtime:cinder-3.8 vol/cinder_typed_prim_bug.py
done 0.57

bad (-X jit -m compile --static):

$ docker run -v $PWD:/vol -it --rm ghcr.io/facebookincubator/cinder-runtime:cinder-3.8 -X jit -m compiler --static vol/cinder_typed_prim_bug.py
Traceback (most recent call last):
  File "/cinder/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/cinder/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/cinder/lib/python3.8/compiler/__main__.py", line 122, in <module>
    exec(codeobj, d, d)
  File "vol/cinder_typed_prim_bug.py", line 15, in __main__
    main()
  File "vol/cinder_typed_prim_bug.py", line 10, in main
    c += foo(.4, .97)
TypeError: unsupported operand type(s) for +=: 'float' and 'function'

The compiler is acting as if the written code were c += foo rather than c += foo(.4, .97).

The problem goes away by removing -X jit, --static, or use of the double primitives.

cinder_typed_prim_bug.py

from __static__ import double

def foo(a: double, b: double) -> double:
    return b - a

def main():
    c = 0.
    c += foo(.4, .97)
    print('done', c)

if __name__ == '__main__':
    main()

seen in cinder-3.8.6c2de94

Dominant language
Python
Stars
3.8k
Forks
139
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from facebookincubator/MetaPython

All issues in facebookincubator/MetaPython

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.