Project

General

Profile

Bug #6434

Updated by shyouhei (Shyouhei Urabe) over 8 years ago

=begin 
 Block is being passed via super implicitly even though the method is explicit and does not pass the block when calling super. 

     

 =begin 
     class H < Hash 
       def initialize(default=nil, &block) 
         super(default) 
       end 
     end 
     H.new(0){} 

     ArgumentError: wrong number of arguments 
     from (pry):3:in `initialize' 
 =end 

 Hash#initialize doesn't allow both a default argument and a default_proc, which is the cause of this error. Which means the block is being passed up even though it should not be. 
 =end

Back