Project

General

Profile

Actions

Backport #8357

closed

Module#prepend breaks comparison operator

Added by skwosh (Alex Goldsmith) almost 11 years ago. Updated almost 11 years ago.


Description

Array < Enumerable # => true
Enumerable.send :prepend, Module.new
Array < Enumerable # => nil
Array.ancestors.include? Enumerable # => true

Same thing happens in 2.0.0-p0.

Possibly similar to what's happening in: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/53106

Actions #1

Updated by marcandre (Marc-Andre Lafortune) almost 11 years ago

  • Priority changed from Normal to 6

Ouch.

=== is also broken:

Enumerable.send :prepend, Module.new
Enumerable === [] # => false, should be true

Updated by marcandre (Marc-Andre Lafortune) almost 11 years ago

  • Assignee set to nobu (Nobuyoshi Nakada)
Actions #3

Updated by nobu (Nobuyoshi Nakada) almost 11 years ago

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

This issue was solved with changeset r40561.
Alex, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


object.c: skip prepending modules

Actions #4

Updated by nagachika (Tomoyuki Chikanaga) almost 11 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Status changed from Closed to Assigned
  • Assignee changed from nobu (Nobuyoshi Nakada) to nagachika (Tomoyuki Chikanaga)
Actions #5

Updated by nagachika (Tomoyuki Chikanaga) almost 11 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40575.
Alex, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 40561: [Backport #8357]

* object.c (rb_obj_is_kind_of): skip prepending modules.
  [ruby-core:54742] [Bug #8357]

* object.c (rb_class_inherited_p): ditto.
  [ruby-core:54736] [Bug #8357]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0