From: "k0kubun (Takashi Kokubun) via ruby-core" Date: 2024-05-29T23:45:57+00:00 Subject: [ruby-core:118082] [Ruby master Bug#20094] Inline while loop behavior changed unexpectedly in 3.3.0 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/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/