Commit 52eaf5ce authored by Robert Bradshaw's avatar Robert Bradshaw

Fix declaration error test.

parent 6837c510
......@@ -535,9 +535,10 @@ class CArrayDeclaratorNode(CDeclaratorNode):
values = [v.analyse_as_type(env) for v in args]
if None in values:
ix = values.index(None)
error(args[ix].pos, "Template parameter not a type.")
return error_type
base_type = base_type.specialize_here(self.pos, values)
error(args[ix].pos, "Template parameter not a type")
base_type = error_type
else:
base_type = base_type.specialize_here(self.pos, values)
return self.base.analyse(base_type, env, nonempty = nonempty)
if self.dimension:
self.dimension = self.dimension.analyse_const_expression(env)
......@@ -591,6 +592,7 @@ class CFuncDeclaratorNode(CDeclaratorNode):
template_nodes = [template_node]
else:
error(template_node.pos, "Template arguments must be a list of names")
return None
self.templates = []
for template in template_nodes:
if isinstance(template, NameNode):
......
......@@ -12,7 +12,8 @@ cdef void f():
_ERRORS = u"""
3:19: Array element cannot be a function
3:20: Template arguments must be a list of names
3:20: Template parameter not a type
5:18: Function cannot return a function
10:10: Function cannot return a function
10:5: Cannot cast to a function 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