Project

General

Profile

Actions

Backport #6899

closed

Flip flop operator broken in IRB (1.9.3, win/osx)

Added by Schwarze (Matthias Schwarze) over 11 years ago. Updated over 11 years ago.

Status:
Closed
[ruby-core:47253]

Description

IRB sometimes fails with "NotImplementedError: method `eql?' called on hidden T_STRING object"

When running this code in IRB, you either get the correct bunch of "345..." or you get the error message above:

2000.times do 20.times do |x| print x if x==3..x==5 end end

You may have to repeat the command several times to get the error!
This does not seem to happen when running this as a script with ruby - just with IRB!

Fresh install of ruby 1.9.3p194 (windows 7: OneClickInstaller / OSX: RVM)
No gems installed or loaded!

Full stack trace:
NotImplementedError: method eql?' called on hidden T_STRING object (0x007f9fd18f2460 flags=0x2805 klass=0x0) from (irb):46:in block (2 levels) in irb_binding'
from (irb):46:in times' from (irb):46:in block in irb_binding'
from (irb):46:in times' from (irb):46 from /Users/schwarze/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in '

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0