ruby-core

Mailing list archive

[#71931] [Ruby trunk - Feature #11786] [Open] [PATCH] micro-optimize case dispatch even harder — normalperson@...

Issue #11786 has been reported by Eric Wong.

9 messages 2015/12/08

[ruby-core:72032] [Ruby trunk - Bug #11802] [Open] Hash.new and {} have different behaviour

From: aufi.cz@...
Date: 2015-12-10 15:26:40 UTC
List: ruby-core #72032
Issue #11802 has been reported by Marek Aufart.

----------------------------------------
Bug #11802: Hash.new and {} have different behaviour
https://bugs.ruby-lang.org/issues/11802

* Author: Marek Aufart
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
It looks that {} is not recognized as a variable sometimes.

irb(main):001:0> p Hash.new
{}
=> {}
irb(main):002:0> p {}
=> nil

Similar in rspec test:

expect(subject.something).to eq {} # fails on not given argument for eq
expect(subject.something).to eq({}) # works




-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next