Commit d74dea45 authored by Xavier Thompson's avatar Xavier Thompson

Fix CheckedResult exception signaling not working with template specialisations

parent 10cc7d66
...@@ -612,6 +612,7 @@ class CheckedResultType(BaseType): ...@@ -612,6 +612,7 @@ class CheckedResultType(BaseType):
error(pos, "Cannot use 'except ~' exception signaling with functions that return by reference") error(pos, "Cannot use 'except ~' exception signaling with functions that return by reference")
elif base_type.is_cpp_class: elif base_type.is_cpp_class:
base_type.check_nullary_constructor(pos) base_type.check_nullary_constructor(pos)
self.pos = pos
self.checked_base_type = base_type self.checked_base_type = base_type
def invalid_value(self): def invalid_value(self):
...@@ -636,7 +637,7 @@ class CheckedResultType(BaseType): ...@@ -636,7 +637,7 @@ class CheckedResultType(BaseType):
return self.checked_base_type.cast_code(expr_code) return self.checked_base_type.cast_code(expr_code)
def specialize(self, values): def specialize(self, values):
return self.checked_base_type.specialize(values) return CheckedResultType(self.pos, self.checked_base_type.specialize(values))
def __repr__(self): def __repr__(self):
return "<CheckedResult[%s]>" % repr(self.checked_base_type) return "<CheckedResult[%s]>" % repr(self.checked_base_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