Project

General

Profile

Actions

Bug #11590

closed

Improve method debugging

Added by Gip-Gip (Charles Thompson) over 8 years ago. Updated over 8 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:71077]

Description

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:

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"));

Updated by Gip-Gip (Charles Thompson) over 8 years ago

  • Assignee deleted (Gip-Gip (Charles Thompson))

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

  • Description updated (diff)
  • Status changed from Open to Rejected

You used the same name as that method.

Actions

Also available in: Atom PDF

Like0
Like0Like0