-
Notifications
You must be signed in to change notification settings - Fork 132
Open
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:
## test3import static
class Board:
def add(self, pos: int64) -> None:
return
## test4from static import int64
from test3 import Boardclass A:
def init(self, b: Board):
self.b: Board = bdef add(self): self.b.add(int64(0))
def main():
bb = Board()
A(bb).add()
returnmain()
$ [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
Metadata
Metadata
Assignees
Labels
No labels