diff options
-rw-r--r-- | enum.c | 2 | ||||
-rw-r--r-- | test/ruby/test_enum.rb | 1 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 4 insertions, 1 deletions
@@ -3847,6 +3847,7 @@ enum_sum(int argc, VALUE* argv, VALUE obj) static VALUE uniq_func(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash)) { + ENUM_WANT_SVALUE(); rb_hash_add_new_element(hash, i, i); return Qnil; } @@ -3854,6 +3855,7 @@ uniq_func(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash)) static VALUE uniq_iter(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash)) { + ENUM_WANT_SVALUE(); rb_hash_add_new_element(hash, rb_yield_values2(argc, argv), i); return Qnil; } diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb index 51efac5150..468a32a9a1 100644 --- a/test/ruby/test_enum.rb +++ b/test/ruby/test_enum.rb @@ -946,5 +946,6 @@ class TestEnumerable < Test::Unit::TestCase assert_equal([[1896, "Athens"], [1900, "Paris"], [1904, "Chicago"], [1908, "Rome"]], olympics.uniq{|k,v| v}) assert_equal([1, 2, 3, 4, 5, 10], (1..100).uniq{|x| (x**2) % 10 }.first(6)) + assert_equal([1, [1, 2]], Foo.new.to_enum.uniq) end end @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.4.2" #define RUBY_RELEASE_DATE "2017-08-05" -#define RUBY_PATCHLEVEL 178 +#define RUBY_PATCHLEVEL 179 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 8 |