Project

General

Profile

Bug #11590

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

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` 
 def operatorDepth str 
	 ` 	 opDepth = 0; 
	 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)` 
 ` 		 opDepth += 1; 
	 end 
	 1;` 
 ` 	 end` 
 ` 	 return opDepth; opDepth;` 
 end `end` 
 puts(operatorDepth("2 `puts(operatorDepth("2 + 2")); 
 ``` 2"));` 

Back