Fix functors (wrapped as __call__) when using -builtin -modern -fastunpack.

This commit is contained in:
William S Fulton 2018-09-19 19:45:57 +01:00
commit c6547ac44e
5 changed files with 57 additions and 1 deletions

View file

@ -0,0 +1,12 @@
from functors import *
a = Functor0(10)
b = Functor1(10)
c = Functor2(10)
if a()!=-10:
raise RuntimeError("a failed")
if b(1)!=11:
raise RuntimeError("b failed")
if c(1, 2)!=13:
raise RuntimeError("c failed")

View file

@ -75,3 +75,10 @@ if not -a==a:
if not -b==Op(-5):
raise RuntimeError("-b==Op(-5)")
# test functors
if not b()==5:
raise RuntimeError("functor")
if not b(1)==6:
raise RuntimeError("functor")
if not b(1, 2)==8:
raise RuntimeError("functor")