Project

General

Profile

Actions

Bug #13669

closed

Enumerable#uniq is ignoring second and following block arguments

Added by kachick (Kenichi Kamiya) almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0dev (2017-06-20 trunk 59122) [x86_64-darwin16]
[ruby-core:<unknown>]

Description

github: https://github.com/ruby/ruby/pull/1658

enum = Object.new.to_enum
class << enum
  def each
    yield
    yield nil
    yield 0
    yield 1
    yield 0, :LABEL
    yield [0, :LABEL]
    yield 1, :LABEL
    yield 1, :LABEL
    yield 1, :DIFFERENT
  end
end

p enum.uniq

Current

[nil, 0, 1, [0, :LABEL]]

Is this intentional?

Expected

[nil, 0, 1, [0, :LABEL], [1, :LABEL], [1, :DIFFERENT]]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0