Project

General

Profile

Feature #17116

Updated by sawa (Tsuyoshi Sawada) over 4 years ago

Currently, Now, `Enumerator#new` allows is allow this code (no block given): code(no given blocks). 

 ```ruby 
 obj = Object.new 
 Enumerator.new(obj) 
 ``` 

 with a But, warning (since ruby-2.0.0-preview2): 

 is displayed(since `ruby-2.0.0-preview2`). 


 ```bash 
 -e:1: warning: Enumerator.new without a block is deprecated; use Object#to_enum instead 
 ``` 

 I think it's okay to remove this behaviour. 
 And I think that it seems natural to raise ArgumentError if no block is given. 

 pull request: 
 https://github.com/ruby/ruby/pull/3408 

Back