Commit f2d4ef48 authored by Tom Niget's avatar Tom Niget

Fix generic methods storage in type objects

parent c5021696
......@@ -67,8 +67,9 @@ class StdlibVisitor(NodeVisitorSeq):
ty.variadic = True
#arg_types.append(TY_VARARG)
if self.cur_class:
assert isinstance(self.cur_class, TypeType)
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:
# ty_inst = FunctionType(arg_types[1:], ret_type)
# 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