summaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-04 09:31:02 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-04 09:31:02 +0000
commit7a153a014e73ffb0c4cd927a82ab6dd4f2366e14 (patch)
tree7c120730347c98ec84af6f5cfdde481be9ee23ae /numeric.c
parentdb694b2183c3c42c64cca32861fd1780e802276c (diff)
downloadruby-7a153a014e73ffb0c4cd927a82ab6dd4f2366e14.tar.gz
ruby-7a153a014e73ffb0c4cd927a82ab6dd4f2366e14.tar.xz
ruby-7a153a014e73ffb0c4cd927a82ab6dd4f2366e14.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@3553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index fe549fb1e..5157b3b64 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);