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

Pass some more tests

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