Project

General

Profile

Bug #11301

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

I don't think it's ideal: 

 ~~~ruby 
 

  module M 
 
  end   

   

  class A 
   
    prepend M 
 
  end   

   

  A.ancestors 
 
  # => [M, A, Object, PP::ObjectMixin, Kernel, BasicObject] 

 

  class B<A 
   
    prepend M 
 
  end   
   
  B.ancestors 
 
  # => [B, M, A, Object, PP::ObjectMixin, Kernel, BasicObject] 
 ~~~ 

 It should be either error (for not adding module) or the module appearing multiple times, 
 i.e. `B.ancestors` B.ancestors to be 

 ~~~ 
 

  [M, B, M, A, Object, PP::ObjectMixin, Kernel, BasicObject] 
 ~~~ 

 Matz. 

Back