Commit 28025b43 authored by Xavier Thompson's avatar Xavier Thompson

Improve compilation errors for 'consume' and cypclass aliasing

parent beb847ce
......@@ -11375,7 +11375,7 @@ class ConsumeNode(ExprNode):
self.operand = self.operand.analyse_types(env)
operand_type = self.operand.type
if not operand_type.is_cyp_class:
error(self.pos, "Can only consume cypclass")
error(self.pos, "Can only consume cypclass (not '%s')" % operand_type)
self.type = PyrexTypes.error_type
return self
if operand_type.is_qualified_cyp_class:
......
......@@ -4894,6 +4894,8 @@ class QualifiedCypclassType(BaseType):
return self.assignable_from_resolved_type(src_type.resolve())
def assignable_from_resolved_type(self, src_type):
if src_type is error_type:
return 1
if src_type.is_null_ptr:
return 1
if src_type.is_qualified_cyp_class and src_type.qualifier in self.assignable_to[self.qualifier]:
......
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