• KOBAYASHI Shuji's avatar
    Singleton class of frozen object should be frozen · 8fa3995a
    KOBAYASHI Shuji authored
    Before this patch:
    
      p (class << Object.new.freeze; self end).frozen?                #=> false
      sc = class << (o=Object.new); self end; o.freeze; p sc.frozen?  #=> false
    
    After this patch / Ruby:
    
      p (class << Object.new.freeze; self end).frozen?                #=> true
      sc = class << (o=Object.new); self end; o.freeze; p sc.frozen?  #=> true
    8fa3995a
kernel.c 24.1 KB