Project

General

Profile

Actions

Backport #1723

closed

respond_to? vs. to_ary

Added by zverok (Victor Shepelev) almost 15 years ago. Updated almost 13 years ago.

Status:
Closed
[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 [#<A:0xb5c9d0>, nil] is expected. If I comment out respond_to? in A, all works as expected
=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 15 years ago

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

=begin
Applied in changeset r23956.
=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) almost 15 years ago

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

=begin

=end

Actions #3

Updated by yugui (Yuki Sonoda) almost 15 years ago

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

=begin
Applied in changeset r24054.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0