Project

General

Profile

Actions

Bug #21175

closed

Range#max called on a beginles Integer Range with excluded end raises TypeError

Bug #21175: Range#max called on a beginles Integer Range with excluded end raises TypeError

Added by andrykonchin (Andrew Konchin) 8 months ago. Updated 8 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:121253]

Description

I would expect that for a Range with Integer right boundary end - 1 is returned:

(nil...10).max
# => (irb):1:in 'Range#max': cannot exclude end value with non Integer begin value (TypeError)

#max works well with non-nil begin:

(1...10).max
# => 9

Related issue - https://bugs.ruby-lang.org/issues/17034

Updated by andrykonchin (Andrew Konchin) 8 months ago Actions #1

  • Description updated (diff)

Updated by andrykonchin (Andrew Konchin) 8 months ago Actions #2

  • Description updated (diff)

Updated by andrykonchin (Andrew Konchin) 8 months ago Actions #3

  • Description updated (diff)

Updated by nobu (Nobuyoshi Nakada) 8 months ago Actions #5

  • Status changed from Open to Closed

Applied in changeset git|cbe3156f82ee8b68e734be58badb9b6a3adc8aa6.


[Bug #21174] [Bug #21175] Fix Range#max on beginless integer range

Actions

Also available in: PDF Atom