summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-05-23 00:15:55 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-05-23 00:19:56 +0900
commitd3f1c615c5b81319e422e9c92e1cb8ba82209fba (patch)
tree66cf55c8efbc4c606d50d186b6d5f990ff928a88 /hash.c
parent4d62296948c36615e73b99d592253256d0ea0d4a (diff)
hash.c (rb_hash_s_create): Reject `Hash[[nil]]`
The behavior of `Hash[[nil]] #=> {}` was a bug until 1.9.3, but had been remained with a warning because some programs depended upon it. Now, six years passed. We can remove the compatibility behavior. [Bug #7300]
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/hash.c b/hash.c
index b4b0415c84..2982afad9d 100644
--- a/hash.c
+++ b/hash.c
@@ -1656,17 +1656,8 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass)
VALUE key, val = Qnil;
if (NIL_P(v)) {
-#if 0 /* refix in the next release */
rb_raise(rb_eArgError, "wrong element type %s at %ld (expected array)",
rb_builtin_class_name(e), i);
-
-#else
- rb_warn("wrong element type %s at %ld (expected array)",
- rb_builtin_class_name(e), i);
- rb_warn("ignoring wrong elements is deprecated, remove them explicitly");
- rb_warn("this causes ArgumentError in the next release");
- continue;
-#endif
}
switch (RARRAY_LEN(v)) {
default: