From: zn@... Date: 2018-08-01T15:21:47+00:00 Subject: [ruby-core:88261] [Ruby trunk Bug#14958] rand(endless_range) raises TypeError (no implicit conversion of Range into Integer) Issue #14958 has been reported by znz (Kazuhiro NISHIYAMA). ---------------------------------------- Bug #14958: rand(endless_range) raises TypeError (no implicit conversion of Range into Integer) https://bugs.ruby-lang.org/issues/14958 * Author: znz (Kazuhiro NISHIYAMA) * Status: Open * Priority: Normal * Assignee: * Target version: 2.6 * ruby -v: ruby 2.6.0dev (2018-08-01 trunk 64154) [x86_64-linux] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- I think TypeError is a bit strange. ```console $ ruby -v ruby 2.6.0dev (2018-08-01 trunk 64154) [x86_64-linux] $ ruby -e 'p rand(1..1)' 1 $ ruby -e 'rand(1..)' Traceback (most recent call last): 1: from -e:1:in `
' -e:1:in `rand': no implicit conversion of Range into Integer (TypeError) $ ruby -e 'rand(nil..nil)' Traceback (most recent call last): 1: from -e:1:in `
' -e:1:in `rand': no implicit conversion of Range into Integer (TypeError) ``` -- https://bugs.ruby-lang.org/ Unsubscribe: