Projects

Ticket #534: macruby_hash_bug.rb

File macruby_hash_bug.rb, 291 bytes (added by rowland@…, 2 years ago)

Simple test case to reproduce error.

Line 
1class Foo
2  def initialize(value)
3    @value = value
4  end
5
6  def to_s
7    "/#{@value} "
8  end
9
10  def hash
11    self.to_s.hash
12  end
13end
14
15h = {}
16h[Foo.new('Subtype')] = 1
17
18# core:in `hash': bignum too big to convert into `long long' (RangeError)
19#         from macruby_hash_bug.rb:in `<main>'