Actions
Bug #20094
closedInline while loop behavior changed unexpectedly in 3.3.0
Bug #20094:
Inline while loop behavior changed unexpectedly in 3.3.0
Description
The behavior of the inline while loop has changed in 3.3.0. This unexpectedly broke my code and I couldn't find anything in the changelog about it so reporting it as a bug.
In ruby <= 3.2:
(p 1) while false # nothing
(p 1; p 2) while false # nothing
In ruby 3.3:
(p 1) while false # 1
(p 1; p 2) while false # 1 2
Essentially, if the left hand side looks like a statement, now it is treated as a do-while loop. In ruby 3.2 and less this only happened with explicit use of begin
and end
.
Actions
Like0
Like1Like0Like0Like0Like0Like0Like0Like0Like0Like0Like1Like1