Correct type annotated returning wrong list size when list expression has generator, also try to derive the size for a few common cases (inspired by the size calculation in the foreach transformation code).
NEW_GEN: Transform list expressions with generators (for in) into a foreach statement and then into while statement. Also allowing list size to be a variable and not only a literal when doing the dynamic list allocation.