Project

General

Profile

Actions

Bug #1731

closed

Enumerable#join with Recursive Structure: "invalid inspect_tbl list for :to_a"

Added by runpaint (Run Paint Run Run) almost 15 years ago. Updated about 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-07-05 trunk 23958) [i686-linux]
Backport:
[ruby-core:24150]

Description

=begin
class Enum
include Enumerable

   def initialize
     @elements = [self]
   end
   def each
     @elements.each {|e| yield e}
   end
 end

 Enum.new.join

This code hangs for a second or so then complains:

$ ruby -vw /tmp/inspect_tbl.rb
ruby 1.9.2dev (2009-07-05 trunk 23958) [i686-linux]
/tmp/inspect_tbl.rb:11:in to_a': invalid inspect_tbl list for :to_a in #<Thread:0x990645c run> (TypeError) from /tmp/inspect_tbl.rb:11:in join'
from /tmp/inspect_tbl.rb:11:in `'
=end

Actions #1

Updated by runpaint (Run Paint Run Run) almost 15 years ago

=begin
Drat. I filed this against the wrong version; it should be against trunk. :-(
=end

Actions #2

Updated by runpaint (Run Paint Run Run) almost 15 years ago

=begin
Apologies if this is obvious, but I just noticed that if you rescue the aforementioned exception then say File.join(['a','b','c']), File will raise an exception "`join': recursive array (ArgumentError)".
=end

Actions #3

Updated by nobu (Nobuyoshi Nakada) almost 15 years ago

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

=begin
Applied in changeset r23966.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0