Commit e0e71d4f authored by Stefan Behnel's avatar Stefan Behnel

better error messages during constant folding, forward constants also through type coercion

parent 475bc21b
...@@ -27,7 +27,8 @@ try: ...@@ -27,7 +27,8 @@ try:
except NameError: except NameError:
from sets import Set as set from sets import Set as set
not_a_constant = object() class NotConstant(object): pass # just for the name
not_a_constant = NotConstant()
constant_value_not_set = object() constant_value_not_set = object()
class ExprNode(Node): class ExprNode(Node):
...@@ -4840,6 +4841,9 @@ class CoercionNode(NewTempExprNode): ...@@ -4840,6 +4841,9 @@ class CoercionNode(NewTempExprNode):
if debug_coercion: if debug_coercion:
print("%s Coercing %s" % (self, self.arg)) print("%s Coercing %s" % (self, self.arg))
def calculate_constant_result(self):
self.constant_result = self.arg.constant_result
def annotate(self, code): def annotate(self, code):
self.arg.annotate(code) self.arg.annotate(code)
if self.arg.type != self.type: if self.arg.type != self.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