diff --git a/mypyc/test-data/fixtures/ir.py b/mypyc/test-data/fixtures/ir.py index afae4b82b9c97..3a92db79dee6a 100644 --- a/mypyc/test-data/fixtures/ir.py +++ b/mypyc/test-data/fixtures/ir.py @@ -115,7 +115,7 @@ def __init__(self, x: object) -> None: pass def __add__(self, n: float) -> float: pass def __radd__(self, n: int) -> float: pass def __sub__(self, n: float) -> float: pass - def __rsub__(self, n: int) -> int: pass + def __rsub__(self, n: int) -> float: pass def __mul__(self, n: float) -> float: pass def __truediv__(self, n: float) -> float: pass def __floordiv__(self, n: float) -> float: pass diff --git a/mypyc/test-data/irbuild-basic.test b/mypyc/test-data/irbuild-basic.test index a06977d037b20..c1898984ccf4c 100644 --- a/mypyc/test-data/irbuild-basic.test +++ b/mypyc/test-data/irbuild-basic.test @@ -1036,15 +1036,16 @@ L0: [case testLoadComplex] def load() -> complex: - return 5j+1.0 + real = 1 + return 5j+real [out] def load(): - r0 :: object - r1 :: float - r2 :: object + real :: int + r0, r1, r2 :: object L0: + real = 2 r0 = 5j - r1 = 1.0 + r1 = box(int, real) r2 = PyNumber_Add(r0, r1) return r2