From: "Earlopain (Earlopain _) via ruby-core" Date: 2026-04-15T14:54:00+00:00 Subject: [ruby-core:125279] [Ruby Bug#22004] parse.y doesn't executes loop body with `while true || true` condition Issue #22004 has been reported by Earlopain (Earlopain _). ---------------------------------------- Bug #22004: parse.y doesn't executes loop body with `while true || true` condition https://bugs.ruby-lang.org/issues/22004 * Author: Earlopain (Earlopain _) * Status: Open * ruby -v: ruby 4.1.0dev (2026-04-15T13:47:25Z master d077df24a2) +PRISM [x86_64-linux] * Backport: 3.3: WONTFIX, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- ```rb while true || true puts 1 end ``` This should never exit but with parse.y, the body is never executed. It seems to happen when one of the conditions is a truthy literal. Something similar happens with `unitl`: ```rb until false && true puts 1 end ``` By moving the literals out to methods that just return them, it behaves like I would expect. Seems to have started happening in Ruby 3.3. -- 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/lists/ruby-core.ml.ruby-lang.org/