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 over 6 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 #1

Updated by nobu (Nobuyoshi Nakada) almost 7 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED
Actions #2

Updated by nobu (Nobuyoshi Nakada) almost 7 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r59128.


Fix Enumerable#uniq with non single yield arguments

Author: Kenichi Kamiya

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Backport changed from 2.2: DONTNEED, 2.3: DONTNEED, 2.4: REQUIRED to 2.2: DONTNEED, 2.3: DONTNEED, 2.4: DONE

ruby_2_4 r59515 merged revision(s) 59128.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0