Commit 9ec9a66f authored by Mark Florisson's avatar Mark Florisson

Pass some more tests

parent a17fac09
......@@ -22,6 +22,8 @@ class CythonScope(ModuleScope):
if type:
return type
return super(CythonScope, self).lookup_type(name)
def create_cython_scope(context):
create_utility_scope(context)
return CythonScope(context)
......
......@@ -3823,16 +3823,17 @@ class SingleAssignmentNode(AssignmentNode):
# See if we're dealing with this:
# dtype = cython.typedef(cython.fused_type(...))
nested_func_name = args[0].function.as_cython_attribute()
if nested_func_name == u'fused_type':
nested_args, nested_kwds = args[0].explicit_args_kwds()
if nested_kwds is not None:
error(self.rhs.pos,
"fused_type does not take keyword arguments")
args[0] = FusedTypeNode(self.rhs.pos,
types=nested_args)
args[0].name = self.lhs.name
if isinstance(args[0], ExprNodes.SimpleCallNode):
nested_func_name = args[0].function.as_cython_attribute()
if nested_func_name == u'fused_type':
nested_args, nested_kwds = args[0].explicit_args_kwds()
if nested_kwds is not None:
error(self.rhs.pos,
"fused_type does not take keyword arguments")
args[0] = FusedTypeNode(self.rhs.pos,
types=nested_args)
args[0].name = self.lhs.name
type = args[0].analyse_as_type(env)
if type is None:
......
......@@ -270,7 +270,7 @@ class SimpleAssignmentTypeInferer(object):
while ready_to_infer:
entry = ready_to_infer.pop()
types = [expr.infer_type(scope) for expr in entry.assignments]
if Utils.all(types):
if types and Utils.all(types):
entry.type = spanning_type(types, entry.might_overflow)
else:
# FIXME: raise a warning?
......
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