Project

General

Profile

Actions

Bug #7298

closed

Behavior of Enumerator.new different between 1.9.3 and 2.0.0

Added by ayumin (Ayumu AIZAWA) about 12 years ago. Updated about 12 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2012-11-07 trunk 37528) [x86_64-darwin12.2.0]
Backport:
[ruby-core:49001]

Description

Under 1.9.3, when Enumerator.new was called with arguments and block, it return Enumerator object.
But under trunk, it makes TypeError.

$ ruby -v -e "p Enumerator.new([1,2,3]){|y|y.yield 4}"
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.2]
#<Enumerator: [1, 2, 3]:each>

$ ./ruby -v -e "p Enumerator.new([1,2,3]){|y|y.yield 4}"
ruby 2.0.0dev (2012-11-07 trunk 37528) [x86_64-darwin12.2.0]
-e:1:in initialize': can't convert Array into Integer (TypeError) from -e:1:in new'
from -e:1:in `'


Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #6636: Enumerable#sizeClosedmarcandre (Marc-Andre Lafortune)06/24/2012Actions
Has duplicate Ruby master - Bug #7313: test_initialize(TestEnumerator) failsClosedmarcandre (Marc-Andre Lafortune)11/09/2012Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0