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 | 72dfee9a96069791b888d1596a48ddd07caf5c51 (patch) | |
tree | 7c120730347c98ec84af6f5cfdde481be9ee23ae /numeric.c | |
parent | f9833b7d5f4cc54193049043e04bf4fcf27b13e6 (diff) |
* 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
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); |