forked from M-Labs/artiq
1
0
Fork 0

Fix types.TFunction.fold.

This commit is contained in:
whitequark 2015-07-04 04:27:24 +03:00
parent 4785f0a2de
commit 549c110e7c
1 changed files with 3 additions and 3 deletions

View File

@ -194,15 +194,15 @@ class TFunction(Type):
def fold(self, accum, fn):
for arg in self.args:
accum = arg.fold(accum, fn)
accum = self.args[arg].fold(accum, fn)
for optarg in self.optargs:
accum = self.optargs[optarg].fold(accum, fn)
accum = self.ret.fold(accum, fn)
return fn(accum, self)
def __repr__(self):
return "py2llvm.types.TFunction(%s, %s, %s)" % \
(repr(self.args), repr(self.optargs), repr(self.ret))
return "py2llvm.types.TFunction({}, {}, {})".format(
repr(self.args), repr(self.optargs), repr(self.ret))
def __eq__(self, other):
return isinstance(other, TFunction) and \