From: gamelinks007@... Date: 2020-08-11T16:10:31+00:00 Subject: [ruby-dev:50945] [Ruby master Feature#17116] raise ArgumentError in Enumerator#new in no given blocks Issue #17116 has been reported by S_H_ (Shun Hiraoka). ---------------------------------------- Feature #17116: raise ArgumentError in Enumerator#new in no given blocks https://bugs.ruby-lang.org/issues/17116 * Author: S_H_ (Shun Hiraoka) * Status: Open * Priority: Normal ---------------------------------------- Now, `Enumerator#new` is allow this code(no given blocks). ```ruby obj = Object.new Enumerator.new(obj) ``` But, warning 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 given. -- https://bugs.ruby-lang.org/