Project

General

Profile

Actions

Bug #22114

open

Endless ranges without parantheses can have unexpected results

Bug #22114: Endless ranges without parantheses can have unexpected results

Added by p8 (Petrik de Heus) about 12 hours ago. Updated about 12 hours ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:125761]

Description

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:

range = 0..
foo = 20
range.end
=> 20

This can be some what unexpected (min would expected to be 100 instead of 20):

min = 100.clamp 0..
max = 20
min
=> 20

Updated by p8 (Petrik de Heus) about 12 hours ago Actions #1

  • Description updated (diff)
Actions

Also available in: PDF Atom