Project

General

Profile

Feature #15881

Updated by Eregon (Benoit Daloze) over 1 year ago

```ruby 
 class A 
   def deconstruct 
     puts 'deconstruct called' 
     [1] 
   end 
 end 

 case A.new 
 in [2] 
   2 
 in [1] 
   1 
 else 
 end 
 ``` 

 Currently this outputs: 
 ``` 
 deconstruct called 
 deconstruct called 
 # => 1 1, prints "deconstruct called" 
 ``` 

 Shouldn't `deconstruct called` print only once, whenever the first deconstruction needed occurs?

Back