Project
Ruby
Priority
Normal
Type
Bug
Fix versions
No Fix versions
State
Open
Assignee
Dennis Ushakov
Subsystem
Refactorings
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Kevin Menard
    3 years ago (19 Jan 2009 16:43)
  • Updated by   Dennis Ushakov
    16 months ago (27 Dec 2010 21:34)
  • Jira: RUBY-2697
    (history, comments)
 
RUBY-2697 Not possible to "rename" constant to ivar.
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
I foolishly started off a test method like so:

def test_retry_exception_strategy_max_tries
MAX_TRIES = 3

. . .
end

I was greeted with:

dynamic constant assignment (SyntaxError)

So, I decided to rename "MAX_TRIES" to "max_tries" and call it a day. The rename refactoring fails, however, with the error message "Same name". Given that variable names in Ruby are case sensitive, it is not the same name. It may be the case that what I ultimately wish to do is simply not possible, but the error message is misleading in any event.

For the record, it doesn't seem that the rename refactoring automatically upcases either, so the aforementioned error message doesn't seem to make sense in any context.
Comments (0)
 
History
 
Linked Issues (?)
 
Issue has no comments