Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash#fetch cannot handle "string" keys #3509

Closed
lkfken opened this issue Dec 1, 2015 · 1 comment
Closed

Hash#fetch cannot handle "string" keys #3509

lkfken opened this issue Dec 1, 2015 · 1 comment

Comments

@lkfken
Copy link

lkfken commented Dec 1, 2015

version: jruby-9.0.3.0

hsh = Hash.new
hsh['production'] = 'some value'
hsh.fetch('production')
KeyError: key not found: :production
        from org/jruby/RubyHash.java:1183:in `fetch'
        from (irb):5:in `<eval>'
        from org/jruby/RubyKernel.java:978:in `eval'
        from org/jruby/RubyKernel.java:1291:in `loop'
        from org/jruby/RubyKernel.java:1098:in `catch'
        from org/jruby/RubyKernel.java:1098:in `catch'

It looks like even I specifically use 'production' as the key, but the fetch method is converting it to a symbol.

The same code works fine in Ruby 1.9.3

@lkfken lkfken closed this as completed Dec 1, 2015
@lkfken
Copy link
Author

lkfken commented Dec 1, 2015

never mind. My mistake...sorry

@enebo enebo added this to the Invalid or Duplicate milestone Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants