Commit e3d6e942 authored by Tom Niget's avatar Tom Niget

Fix generic methods storage in type objects

parent 68ea4de6
...@@ -67,8 +67,9 @@ class StdlibVisitor(NodeVisitorSeq): ...@@ -67,8 +67,9 @@ class StdlibVisitor(NodeVisitorSeq):
ty.variadic = True ty.variadic = True
#arg_types.append(TY_VARARG) #arg_types.append(TY_VARARG)
if self.cur_class: if self.cur_class:
assert isinstance(self.cur_class, TypeType)
if isinstance(self.cur_class.type_object, ABCMeta): if isinstance(self.cur_class.type_object, ABCMeta):
self.cur_class.gen_methods[node.name] = lambda t: ty.gen_sub(t, self.typevars) self.cur_class.type_object.gen_methods[node.name] = lambda t: ty.gen_sub(t, self.typevars)
else: else:
# ty_inst = FunctionType(arg_types[1:], ret_type) # ty_inst = FunctionType(arg_types[1:], ret_type)
# self.cur_class.args[0].add_inst_member(node.name, ty_inst) # self.cur_class.args[0].add_inst_member(node.name, ty_inst)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment