Commit 073f25c1 authored by da-woods's avatar da-woods

Bring attribute.fused types in line

parent 1b5b0a51
......@@ -6907,14 +6907,20 @@ class AttributeNode(ExprNode):
return None
def analyse_as_type(self, env):
tp = None
module_scope = self.obj.analyse_as_module(env)
if module_scope:
return module_scope.lookup_type(self.attribute)
if not self.obj.is_string_literal:
tp = module_scope.lookup_type(self.attribute)
elif not self.obj.is_string_literal:
base_type = self.obj.analyse_as_type(env)
if base_type and hasattr(base_type, 'scope') and base_type.scope is not None:
return base_type.scope.lookup_type(self.attribute)
return None
tp = base_type.scope.lookup_type(self.attribute)
if tp and tp.is_fused and env.fused_to_specific:
try:
tp = tp.specialize(env.fused_to_specific)
except KeyError:
pass # just use unspecialized type
return tp
def analyse_as_extension_type(self, env):
# Try to interpret this as a reference to an extension type
......
......@@ -30,3 +30,14 @@ def typeid_call(C x):
"""
cdef const type_info* a = &typeid(C)
return a[0] == tidint[0]
cimport cython
def typeid_call2(cython.integral x):
"""
For GH issue 3203
>>> typeid_call2[int](1)
True
"""
cdef const type_info* a = &typeid(cython.integral)
return a[0] == tidint[0]
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