Commit 48adadf1 authored by Stefan Behnel's avatar Stefan Behnel

use inferred NameNode type for builtin types instead of more generic entry type

parent dab03a3c
......@@ -1755,6 +1755,10 @@ class NameNode(AtomicExprNode):
self.check_identifier_kind()
entry = self.entry
type = entry.type
if (type.is_pyobject and self.inferred_type and
self.inferred_type.is_builtin_type):
# assume that type inference is smarter than the static entry
type = self.inferred_type
self.type = type
def check_identifier_kind(self):
......
......@@ -252,6 +252,23 @@ def iter_and_in():
if c in u'abCDefGh':
print c
#@cython.test_fail_if_path_exists('//ForInStatNode')
def iter_inferred():
"""
>>> iter_inferred()
a
b
c
d
e
"""
uchars = list(u"abcde")
uchars = u''.join(uchars)
for c in uchars:
print c
@cython.test_assert_path_exists('//SwitchStatNode',
'//ForFromStatNode')
@cython.test_fail_if_path_exists('//ForInStatNode')
......
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