Open
Description
I'm not sure if this is the fault of const propagation (probably not?), but these examples (more examples, but a lot more messy) result in unexpected code.
In some instances, the function bodies are evaluated and are replaced by a constant value as expected. However, given some usage patterns, (the most simple is an extra iterator.next
call where the return value is ignored) this simplification does not happen. It's not clear why some patterns can be simplified and others can't.