Skip to content

Commit

Permalink
Avoid constant folding in tests where it's unwanted + fix stub
Browse files Browse the repository at this point in the history
  • Loading branch information
ichard26 committed Mar 5, 2023
1 parent 3bae7d9 commit eb204a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mypyc/test-data/fixtures/ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions mypyc/test-data/irbuild-basic.test
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit eb204a9

Please sign in to comment.