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 153074 - Detect incorrect hash assignments
Summary: Detect incorrect hash assignments
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-12 21:18 UTC by fjan11
Modified: 2009-02-19 23:01 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
6.5 build of the extra hints module (19.05 KB, application/octet-stream)
2008-11-13 02:39 UTC, Torbjorn Norbye
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fjan11 2008-11-12 21:18:53 UTC
It would be great if the Netbeans editor could highlight the following problem:
some_function(:a => 1, b=> 2, a => 3)

Of course, the last key value pair overwrites the first one. Rails has functions that accept options hashes 10 items long, and I have on several occasions made 
the mistake of including an option twice, leading to hard to track down bugs.
Comment 1 Torbjorn Norbye 2008-11-12 23:29:51 UTC
Great idea!

This should be trivial to implement with the hints infrastructure.
Comment 2 Torbjorn Norbye 2008-11-13 02:39:03 UTC
Fixed in changeset 5a1e61e6d1a5.  That's for 7.0. I'm attaching a 6.5 compatible version as well.

Comment 3 Torbjorn Norbye 2008-11-13 02:39:44 UTC
Created attachment 73712 [details]
6.5 build of the extra hints module