Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JRuby 1.0.2, JRuby 1.1b1
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:OS X, java 1.5, ruby 1.8.5 (2007-10-11 rev 3876) [i386-jruby1.1]
-
Number of attachments :
Description
I'm not sure where's it's getting the "w" from. Should just be "a".
irb(main):001:0> r = Range.new('a', 'd')
=> "a".."d"
irb(main):002:0> r.step(100){ |e| p e }
"a"
"cw"
=> "a".."d"
I know why: 'cw' is the 100th successor of 'a', it seems. Try:
x= 'a'; 100.times { x = x.succ; p x }So it's printing the last element when (I assume from MRI) it shouldn't.
x= 'a'; 100.times { x = x.succ; p x }