diff options
-rw-r--r-- | struct.c | 2 | ||||
-rw-r--r-- | test/ruby/test_struct.rb | 1 |
2 files changed, 2 insertions, 1 deletions
@@ -1202,7 +1202,7 @@ rb_struct_hash(VALUE s) h = rb_hash_uint(h, NUM2LONG(n)); } h = rb_hash_end(h); - return INT2FIX(h); + return ST2FIX(h); } static VALUE diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb index 4748419d6b..db3d767edd 100644 --- a/test/ruby/test_struct.rb +++ b/test/ruby/test_struct.rb @@ -275,6 +275,7 @@ module TestStruct klass = @Struct.new(:a) o = klass.new(1) assert_kind_of(Integer, o.hash) + assert_kind_of(String, o.hash.to_s) end def test_eql |