Actions
Bug #5442
closedheredoc inside Hash initialization
Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
1.9.2p290 (2011-07-09 revision 32553)
Backport:
Description
Shouldn't this initialization be valid?
Hash[:a,<<-EOS
some text
EOS
,:b,'other']
gives the following error
syntax error, unexpected ',', expecting ']'
Updated by shyouhei (Shyouhei Urabe) over 13 years ago
- 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
Updated by jhej (Jonatan Hejzlar) over 13 years ago
I see, thanks
Actions
Like0
Like0Like0