Commit 52679b28 authored by Stefan Behnel's avatar Stefan Behnel

infer builtin/extension types from type constructors

parent e6842141
...@@ -1072,8 +1072,8 @@ class NameNode(AtomicExprNode): ...@@ -1072,8 +1072,8 @@ class NameNode(AtomicExprNode):
elif (self.entry.type.is_extension_type or self.entry.type.is_builtin_type) and \ elif (self.entry.type.is_extension_type or self.entry.type.is_builtin_type) and \
self.name == self.entry.type.name: self.name == self.entry.type.name:
# Unfortunately the type attribute of type objects # Unfortunately the type attribute of type objects
# is used for the pointer to the type the represent. # is used for the pointer to the type they represent.
return type_type return self.entry.type # type_type
else: else:
return self.entry.type return self.entry.type
...@@ -2396,6 +2396,11 @@ class SimpleCallNode(CallNode): ...@@ -2396,6 +2396,11 @@ class SimpleCallNode(CallNode):
func_type = func_type.base_type func_type = func_type.base_type
if func_type.is_cfunction: if func_type.is_cfunction:
return func_type.return_type return func_type.return_type
elif func_type.is_extension_type:
return func_type
elif func_type.is_builtin_type and \
func_type.name in Builtin.types_that_construct_their_instance:
return func_type
else: else:
return py_object_type return py_object_type
......
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