[ruby-core:115923] [Ruby master Bug#20094] Inline while loop behavior changed unexpectedly in 3.3.0

Issue #20094 has been reported by sisyphus_cg (Sisyphus CG). ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094 * Author: sisyphus_cg (Sisyphus CG) * Status: Open * Priority: Normal * ruby -v: 3.3.0 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/

Issue #20094 has been updated by nobu (Nobuyoshi Nakada). https://github.com/ruby/ruby/pull/9373 ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094#change-105882 * Author: sisyphus_cg (Sisyphus CG) * Status: Open * Priority: Normal * ruby -v: 3.3.0 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/

Issue #20094 has been updated by jeremyevans0 (Jeremy Evans). Status changed from Open to Closed Fixed by commit:bc002971b6ad483dbf69b8a275c44412bb6ab954 ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094#change-105932 * Author: sisyphus_cg (Sisyphus CG) * Status: Closed * Priority: Normal * ruby -v: 3.3.0 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/

Issue #20094 has been updated by naruse (Yui NARUSE). Backport changed from 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED to 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ruby_3_3 119d447d42d4645ac919ee53f3ec294deaa7c59b merged revision(s) bc002971b6ad483dbf69b8a275c44412bb6ab954. ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094#change-106572 * Author: sisyphus_cg (Sisyphus CG) * Status: Closed * Priority: Normal * ruby -v: 3.3.0 * Backport: 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/

Issue #20094 has been updated by rbjl (Jan Lelis). It seems the bug is still present in Ruby 3.3.1: ```ruby (p 1) while false # 1 ``` ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094#change-108143 * Author: sisyphus_cg (Sisyphus CG) * Status: Closed * ruby -v: 3.3.0 * Backport: 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/

Issue #20094 has been updated by Eregon (Benoit Daloze). Indeed: ``` $ ruby -ve '(p 1) while false' ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux] $ ruby -ve '(p 1) while false' ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux] 1 ``` ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094#change-108165 * Author: sisyphus_cg (Sisyphus CG) * Status: Closed * ruby -v: 3.3.0 * Backport: 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/

Issue #20094 has been updated by nevans (Nicholas Evans). Can we reopen this bug (please), or should we create a new issue? ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094#change-108376 * Author: sisyphus_cg (Sisyphus CG) * Status: Closed * ruby -v: 3.3.0 * Backport: 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/

Issue #20094 has been updated by nagachika (Tomoyuki Chikanaga). ruby -v changed from 3.3.0 to 3.3.1 Backport changed from 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE to 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED I see the issue was fixed on master branch. I will revert back Backport field to "3.3: REQUIRED", but stay the ticket status "Closed. ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094#change-108378 * Author: sisyphus_cg (Sisyphus CG) * Status: Closed * ruby -v: 3.3.1 * Backport: 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/

Issue #20094 has been updated by nagachika (Tomoyuki Chikanaga). I have found that the backport commit was reverted at https://github.com/ruby/ruby/commit/9f18cbd7964f32f224e7d0efba79ee0476a442e0. ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094#change-108379 * Author: sisyphus_cg (Sisyphus CG) * Status: Closed * ruby -v: 3.3.1 * Backport: 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/

Issue #20094 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED to 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ruby_3_3 commit:0044b6aefc656874adb9266829f19870dcd3d75e merged revision(s) commit:bc002971b6ad483dbf69b8a275c44412bb6ab954. ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094#change-108508 * Author: sisyphus_cg (Sisyphus CG) * Status: Closed * ruby -v: 3.3.1 * Backport: 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/

Issue #20094 has been updated by k0kubun (Takashi Kokubun). It was previously reverted presumably because the cherry-pick of commit:bc002971b6ad483dbf69b8a275c44412bb6ab954 to `ruby_3_3` doesn't really work. I had to manually create a whole backport patch without relying on git for that reason. I encourage people to file a backport pull request to `ruby_3_3` (and make the CI green, which was the hard thing for this ticket) if you want to see a change backported to stable branches. ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094#change-108509 * Author: sisyphus_cg (Sisyphus CG) * Status: Closed * ruby -v: 3.3.1 * Backport: 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/

Issue #20094 has been updated by k0kubun (Takashi Kokubun).
It seems like the bug is still present in Ruby 3.3.1
Ruby 3.3.2 has been released today. It shouldn't have this issue. ---------------------------------------- Bug #20094: Inline while loop behavior changed unexpectedly in 3.3.0 https://bugs.ruby-lang.org/issues/20094#change-108518 * Author: sisyphus_cg (Sisyphus CG) * Status: Closed * ruby -v: 3.3.1 * Backport: 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ---------------------------------------- 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: ``` ruby (p 1) while false # nothing (p 1; p 2) while false # nothing ``` In ruby 3.3: ``` ruby (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`. -- https://bugs.ruby-lang.org/
participants (9)
-
Eregon (Benoit Daloze)
-
jeremyevans0 (Jeremy Evans)
-
k0kubun (Takashi Kokubun)
-
nagachika (Tomoyuki Chikanaga)
-
naruse (Yui NARUSE)
-
nevans (Nicholas Evans)
-
nobu (Nobuyoshi Nakada)
-
rbjl (Jan Lelis)
-
sisyphus_cg (Sisyphus CG)