diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-04 09:31:02 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-04 09:31:02 +0000 |
commit | 7a153a014e73ffb0c4cd927a82ab6dd4f2366e14 (patch) | |
tree | 7c120730347c98ec84af6f5cfdde481be9ee23ae /numeric.c | |
parent | db694b2183c3c42c64cca32861fd1780e802276c (diff) | |
download | ruby-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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |