* [ruby-dev:50945] [Ruby master Feature#17116] raise ArgumentError in Enumerator#new in no given blocks
@ 2020-08-11 16:10 gamelinks007
0 siblings, 0 replies; only message in thread
From: gamelinks007 @ 2020-08-11 16:10 UTC (permalink / raw)
To: ruby-dev
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/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-11 16:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11 16:10 [ruby-dev:50945] [Ruby master Feature#17116] raise ArgumentError in Enumerator#new in no given blocks gamelinks007
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).