Project

General

Profile

Backport #1723

respond_to? vs. to_ary

Added by zverok (Victor Shepelev) almost 10 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:24139]

Description

=begin
# class with respond_to? redefined
class A
def respond_to?(m); false end
end

x = [A.new]

# deconstructing iteration
x.each do |a, b| p [a,b] end

It outputs [nil, nil], while [#, nil] is expected. If I comment out respond_to? in A, all works as expected
=end

History

#1

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

  • Category set to core
  • Status changed from Open to Closed

=begin
Applied in changeset r23956.
=end

#2

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

  • Status changed from Closed to Assigned
  • Assignee set to yugui (Yuki Sonoda)

=begin

=end

#3

Updated by yugui (Yuki Sonoda) almost 10 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24054.
=end

Also available in: Atom PDF