From: "nobu (Nobuyoshi Nakada)" Date: 2013-12-23T13:54:09+09:00 Subject: [ruby-core:59274] [ruby-trunk - Bug #9275] Class.new(Hash)#reject warning is confusing and is issued in situations where I don't think it should be Issue #9275 has been updated by nobu (Nobuyoshi Nakada). Description updated ---------------------------------------- Bug #9275: Class.new(Hash)#reject warning is confusing and is issued in situations where I don't think it should be https://bugs.ruby-lang.org/issues/9275#change-43839 Author: myronmarston (Myron Marston) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.1.0dev (2013-12-20 trunk 44301) [x86_64-darwin12.0] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN =begin Consider this script: $VERBOSE = true Class.new(Hash).new.reject { } When I run this with 2.1.0-rc1, I get the following output: foo.rb:2: warning: copying unguaranteed attributes: {} foo.rb:2: warning: following atributes will not be copied in the future version: foo.rb:2: warning: subclass: # This warning is confusing. I've been using ruby full time for ~ 5 years and I have no idea what "unguaranteed attributes" means. In addition, I don't think this warning should be issued in this case at all. According to (()) and #9223, this warning is intended for cases where there is extra state (instance variables, default proc, etc) that will not be copied in the future...but in this case, it's a subclass of Hash with no extra state or behavior. Why should it warn in this case? As things stand now, if you want to have a warning-free gem, you can no longer subclass hash if you call #reject on it or expose it as part of your public API (as end users may call #reject on it). =end -- http://bugs.ruby-lang.org/