0

I'm trying to understand if this is an error on Ruby 2.3.1 or 2.3.0.

If the first return is the expected, IMHO this should work on both versions.

Why a minor change and bugfixes produced different results?

I'm currently facing the following problems on Ruby 2.3.1:

#ruby 2.3.0p0
nil[:a] = nil
#returns nil


#ruby 2.3.1p112
nil[:a] = nil
#returns the following error:
NoMethodError: undefined method `[]=' for nil:NilClass
    from (irb):1
    from ...rbenv/versions/2.3.1/bin/irb:11:in `<main>'
AndreDurao
  • 5,600
  • 7
  • 41
  • 61
  • 6
    I think this is a bug in 2.3.0: https://bugs.ruby-lang.org/issues/11976. See also http://stackoverflow.com/questions/36829168/in-ruby-why-does-nil1-1-evaluate-to-nil – matt May 25 '16 at 18:52
  • Thanks Matt: I think is definitively that. – AndreDurao May 25 '16 at 19:12

0 Answers0