From: nobu@... Date: 2015-10-14T06:52:17+00:00 Subject: [ruby-core:71083] [Ruby trunk - Bug #11590] [Rejected] Improve method debugging Issue #11590 has been updated by Nobuyoshi Nakada. Description updated Status changed from Open to Rejected You used the same name as that method. ---------------------------------------- Bug #11590: Improve method debugging https://bugs.ruby-lang.org/issues/11590#change-54448 * Author: Charles Thompson * Status: Rejected * Priority: Normal * Assignee: * ruby -v: 2.2.3 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- I forgot to rename a variable that controlled array access inside a method. When I ran the program, Ruby told me that I was not providing enough arguments to the method, instead of saying the variable was not initialized, or something like that. So you can recreate it, here's a sample of code: ```ruby def operatorDepth str opDepth = 0; while str[opDepth] != '+' and str[opDepth] != '-' and \ str[operatorDepth] != '=' and opDepth < str.length #The line in error(forgot to replace operatorDepth with opDepth) opDepth += 1; end return opDepth; end puts(operatorDepth("2 + 2")); ``` -- https://bugs.ruby-lang.org/