Answer the question
In order to leave comments, you need to log in
In what situation can a variable be undefined?
There is the following code.
The code is specially prepared for the question.
def method_name(key)
42.times do
key
raise 'raise message'
end
end
This inspection reports about dangerous usages of local variables or parameters, such as implicit or undefined local variable or parameter that shadows an outer local variable or parameter. Using data flow analysis, the IDE checks usages of local variables in your code and shows you the possible errors, e.g. that a local variable may not be defined yet on some control flow, etc.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question