Commit ce7ad25e authored by Stefan Behnel's avatar Stefan Behnel

set constant_result on BoolNode creation

parent 4649e2f1
...@@ -985,7 +985,8 @@ class BytesNode(ConstNode): ...@@ -985,7 +985,8 @@ class BytesNode(ConstNode):
def coerce_to_boolean(self, env): def coerce_to_boolean(self, env):
# This is special because testing a C char* for truth directly # This is special because testing a C char* for truth directly
# would yield the wrong result. # would yield the wrong result.
return BoolNode(self.pos, value=bool(self.value)) bool_value = bool(self.value)
return BoolNode(self.pos, value=bool_value, constant_result=bool_value)
def coerce_to(self, dst_type, env): def coerce_to(self, dst_type, env):
if self.type == dst_type: if self.type == dst_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