From: ko1@... Date: 2015-04-06T07:18:56+00:00 Subject: [ruby-core:68767] [Ruby trunk - Bug #11035] [Open] Calling #hash method: inconsistency between dynamic and static symbols Issue #11035 has been reported by Koichi Sasada. ---------------------------------------- Bug #11035: Calling #hash method: inconsistency between dynamic and static symbols https://bugs.ruby-lang.org/issues/11035 * Author: Koichi Sasada * Status: Open * Priority: Normal * Assignee: Yukihiro Matsumoto * ruby -v: 2.3dev * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- There is an inconsistency between static symbols and dynamic symbols. ```ruby class Symbol def hash raise end end h = {} h[:foo] = 1 #=> no problem h['bar'.to_sym] = 2 #=> unhandled exception ``` I think it should be same behavior. My favorite is skip calling #hash for all Symbol objects. -- https://bugs.ruby-lang.org/