Re: Proposing new warning

Hassan Schroeder <[email protected]>
Newsgroups gmane.comp.lang.ruby.general
Message-ID <CACmC4yBNc2owTBv3hU=gMePQLTtV3jCWbizeo4_3OQ4TTFuZ1Q@mail.gmail.com>
On Tue, Oct 23, 2018 at 8:44 AM Ale Miralles <[email protected]> wrote:
>
> "What if I store both string and symbols in a hash?"
> If I were doing that, I would appreciate a warning.

I'm not sure I understand why -- *any* object can be a Hash key, not
only strings or symbols.

If I had a use case for requiring keys to be the same type I would
probably either subclass Hash or rely on a linter like RuboCop.

-- 
Hassan Schroeder ------------------------ [email protected]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.