ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
From: gamelinks007@gmail.com
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:50945] [Ruby master Feature#17116] raise ArgumentError in Enumerator#new in no given blocks
Date: Tue, 11 Aug 2020 16:10:31 +0000 (UTC)	[thread overview]
Message-ID: <redmine.issue-17116.20200811161030.35524@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-17116.20200811161030.35524@ruby-lang.org>

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/

           reply	other threads:[~2020-08-11 16:10 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <redmine.issue-17116.20200811161030.35524@ruby-lang.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.issue-17116.20200811161030.35524@ruby-lang.org \
    --to=gamelinks007@gmail.com \
    --cc=ruby-dev@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).