Project

General

Profile

Actions

Bug #6378

closed

irb incorrectly considers line incomplete when parenthesis are excluded

Added by devans (Daniel Evans) about 12 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.2.0]
Backport:
[ruby-core:44753]

Description

Steps to reproduce:

start irb
attempt to execute the following line:
[1,2,3].reduce :+

Expected:
a result of => 6 should be printed and a new line should be available

Actual:
The result is not printed and the shell indicates more lines are expected

irb(main):001:0> [1,2,3].reduce :+
irb(main):002:0*

Workaround:
add parenthesis to the method call:
[1,2,3].reduce(:+)

Notes:
The line is executed, as evidenced by changing the symbol to represent a message to which FixNum does not respond, such as :_ after which the error message will be printed immediately.

This is also reproducible in ruby 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux]

irb versions tested:
irb 0.9.6(09/06/30)
irb 0.9.5(05/04/13)

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0