forked from M-Labs/artiq
Fix types.TFunction.fold.
This commit is contained in:
parent
4785f0a2de
commit
549c110e7c
|
@ -194,15 +194,15 @@ class TFunction(Type):
|
||||||
|
|
||||||
def fold(self, accum, fn):
|
def fold(self, accum, fn):
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
accum = arg.fold(accum, fn)
|
accum = self.args[arg].fold(accum, fn)
|
||||||
for optarg in self.optargs:
|
for optarg in self.optargs:
|
||||||
accum = self.optargs[optarg].fold(accum, fn)
|
accum = self.optargs[optarg].fold(accum, fn)
|
||||||
accum = self.ret.fold(accum, fn)
|
accum = self.ret.fold(accum, fn)
|
||||||
return fn(accum, self)
|
return fn(accum, self)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "py2llvm.types.TFunction(%s, %s, %s)" % \
|
return "py2llvm.types.TFunction({}, {}, {})".format(
|
||||||
(repr(self.args), repr(self.optargs), repr(self.ret))
|
repr(self.args), repr(self.optargs), repr(self.ret))
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return isinstance(other, TFunction) and \
|
return isinstance(other, TFunction) and \
|
||||||
|
|
Loading…
Reference in New Issue