From 72dfee9a96069791b888d1596a48ddd07caf5c51 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 4 Mar 2003 09:31:02 +0000 Subject: * array.c (rb_ary_aref): give warning if index is a symbol. [ruby-list:37217] * array.c (rb_ary_aset): raise TypeError if index is a symbol. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index fe549fb1ee..5157b3b64f 100644 --- a/numeric.c +++ b/numeric.c @@ -943,6 +943,9 @@ rb_num2long(val) case T_BIGNUM: return rb_big2long(val); + case T_SYMBOL: + rb_warning("treating Symbol as an integer"); + /* fall through */ default: val = rb_to_int(val); return NUM2LONG(val); -- cgit v1.2.3