Project

General

Profile

Bug #14958

Updated by znz (Kazuhiro NISHIYAMA) over 1 year ago

I think TypeError message 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 `<main>' 
 -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 `<main>' 
 -e:1:in `rand': no implicit conversion of Range into Integer (TypeError) 
 ```

Back