Project

General

Profile

Actions

Feature #8691

closed

Add warning for variable that is re-assigned but not re-used

Added by agrimm (Andrew Grimm) over 11 years ago. Updated about 11 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:56184]

Description

The following code

def reassigned_unused
a = 42
b = a.to_s
a = 56
b
end

Does not currently generate an "assigned but unused variable" warning about the second assignment to "a".

Is it feasible to create a warning for such a scenario?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0