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

Confusing int64 error at cyclic class boundary

Open
#146 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start with the cyclic reproducer in test1.py and test2.py, then compare it with the non-cyclic test3 and test4 cases. Run both examples with static-python and trace how the annotated Board.add call is resolved across the cycle. Done means the cyclic case reports the same correct primitive-argument error as the non-cyclic case.

Written by the indexing model from the issue text.

Description

I have a method that expects an int64, but when I call it from another, special location the error says expected an int.

The other location is across a cyclic dependency: file test1 imports file test2, but the class inside test2 expects an object defined in test1 as an init param:

## test2.py , home of class A

from __future__ import annotations
from __static__ import int64

class A:
    def __init__(self, b: Board):
        self.b: Board = b

    def add(self):
        self.b.add(int64(0))
## test1.py , home of class Board

from __static__ import int64
from test2 import A

class Board:
    def add(self, pos: int64) -> None:
        return

def main():
    bb = Board()
    A(bb).add()
    return

main()
$ [static-python] test1.py
  ....
  File "/vol/static-python-perf/Benchmark/go/advanced/test2.py", line 9, in add
    self.b.add(int64(0))
TypeError: add expected 'int' for argument pos, got 'int64'

The correct error is that call arguments cannot be primitive --- right? That's what I see without the cycle:

## test3

import static

class Board:
def add(self, pos: int64) -> None:
return


## test4

from static import int64
from test3 import Board

class A:
def init(self, b: Board):
self.b: Board = b

def add(self):
    self.b.add(int64(0))

def main():
bb = Board()
A(bb).add()
return

main()


$ [static-python] test4.py
 ....
    raise exception
  File "test4.py", line 9
    self.b.add(int64(0))
              ^
cinderx.compiler.errors.TypedSyntaxError: Call argument cannot be a primitive
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.