From: "shyouhei (Shyouhei Urabe) via ruby-core" Date: 2026-06-15T01:50:26+00:00 Subject: [ruby-core:125764] [Ruby Bug#22114] Endless ranges without parantheses can have unexpected results Issue #22114 has been updated by shyouhei (Shyouhei Urabe). Status changed from Open to Rejected This is by design. We want this to work: ```ruby Time.local(2026, 06, 15, 23, 59, 59) ... Time.local(2026, 06, 16, 00, 00, 00) ``` It is a lot easier to read than in one line. ---------------------------------------- Bug #22114: Endless ranges without parantheses can have unexpected results https://bugs.ruby-lang.org/issues/22114#change-117679 * Author: p8 (Petrik de Heus) * Status: Rejected * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- If a line ends with a endless ranges without parantheses, the range will continue on the next line making it the end of the range: ``` ruby range = 0.. foo = 20 range.end => 20 ``` This can be some what unexpected (min would expected to be 100 instead of 20): ```ruby min = 100.clamp 0.. max = 20 min => 20 ``` -- 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/