This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 96490 - Variable incorrectly highlighted as unused
Summary: Variable incorrectly highlighted as unused
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-24 01:33 UTC by _ tboudreau
Modified: 2007-07-03 14:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screen shot (6.98 KB, image/png)
2007-02-24 01:34 UTC, _ tboudreau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2007-02-24 01:33:31 UTC
In the following code, the line "found = true" shows up incorrectly with "found"
in the light gray of an unused variable.

foo = "d"
found = false
alreadyFound = ["a", "b", "c", "d"]
alreadyFound.each_with_index {|item, index|
  if (foo.eql?item)
    found = true
  end
}
print "Found? " + found.to_s
Comment 1 _ tboudreau 2007-02-24 01:34:00 UTC
Created attachment 38882 [details]
Screen shot
Comment 2 Torbjorn Norbye 2007-02-24 03:10:01 UTC
Fixed.

Thanks for the testcase. This happened when the block was in top-level scope
(not inside any methods). In the case that there is no surrounding method I now
search from the top level scope.
Comment 3 Jiri Kovalsky 2007-07-03 14:08:15 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 4 Jiri Kovalsky 2007-07-03 14:35:59 UTC
Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build.