From: matias@... Date: 2014-03-07T19:28:05+00:00 Subject: [ruby-core:61372] [ruby-trunk - Bug #9611] Arithmetic operator following parentheses-less method gives ArgumentError Issue #9611 has been updated by Mat��as Battocchia. Even though this also happens with +, * and /, I guess it is on purpose to pass negative numbers, not a bug. My mistake. ---------------------------------------- Bug #9611: Arithmetic operator following parentheses-less method gives ArgumentError https://bugs.ruby-lang.org/issues/9611#change-45683 * Author: Mat��as Battocchia * Status: Open * Priority: Normal * Assignee: Yukihiro Matsumoto * Category: syntax * Target version: * ruby -v: 2.0.0p195 * Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- It would be better to explain this with an example: > 'a'.length -1 ArgumentError: wrong number of arguments (1 for 0) from (pry):1:in `length' Other ways of writing this expression work as expected: > 'a'.length() -1 => 0 > 'a'.length-1 => 0 > 'a'.length- 1 => 0 > 'a'.length - 1 => 0 -- http://bugs.ruby-lang.org/