Actions
Bug #11035
closedCalling #hash method: inconsistency between dynamic and static symbols
ruby -v:
2.3dev
Description
There is an inconsistency between static symbols and dynamic symbols.
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.
Actions
Like0
Like0Like0Like0