Project

General

Profile

Actions

Bug #4561

closed

1.9.2 requires parentheses around argument of method call in an array, where 1.8.7 did not

Added by dschweisguth (Dave Schweisguth) over 13 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
-
Backport:
[ruby-core:35637]

Description

[dave hladik:~] cat method_call_without_parens_in_array.rb
def method_name(arg)
end

[ method_name 'value' ]
[dave hladik:~] ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10]
[dave hladik:~] ruby method_call_without_parens_in_array.rb
[dave hladik:~] rvm 1.9.2
[dave hladik:~] ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
[dave hladik:~] ruby method_call_without_parens_in_array.rb
method_call_without_parens_in_array.rb:4: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
[ method_name 'value' ]
^
method_call_without_parens_in_array.rb:4: syntax error, unexpected ']', expecting $end
[dave hladik:~] rvm system
[dave hladik:~] ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10]
[dave hladik:~] cat method_call_with_parens_in_array.rb
def method_name(arg)
end

[ method_name('value') ]
[dave hladik:~] ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10]
[dave hladik:~] ruby method_call_with_parens_in_array.rb
[dave hladik:~] rvm 1.9.2
[dave hladik:~] ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
[dave hladik:~] ruby method_call_with_parens_in_array.rb

no error


Files

method_call_without_parens_in_array.rb (50 Bytes) method_call_without_parens_in_array.rb dschweisguth (Dave Schweisguth), 04/07/2011 01:41 PM
method_call_with_parens_in_array.rb (51 Bytes) method_call_with_parens_in_array.rb dschweisguth (Dave Schweisguth), 04/07/2011 01:41 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0