Issue #5442 has been updated by Shyouhei Urabe.

Status changed from Open to Rejected

That's identical to

Hash[:a, "some text\n"
,:b,'other']

and produces a same error.  So it is consistent. Place the comma beforehand. i.e.

Hash[:a, <<-EOS, :b, 'other']
some text
EOS
----------------------------------------
Bug #5442: heredoc inside Hash initialization
http://redmine.ruby-lang.org/issues/5442

Author: Jonatan Hejzlar
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: 1.9.2p290 (2011-07-09 revision 32553)


Shouldn't this initialization be valid?

Hash[:a,<<-EOS
some text
EOS
,:b,'other']

gives the following error
  syntax error, unexpected ',', expecting ']'


-- 
http://redmine.ruby-lang.org