mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
range.c: reject ArithmeticSequence in rb_range_values
Reject ArithmeticSequence in rb_range_values so that methods like Array#[] raises TypeError for ArithmeticSequence as an index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fa5601e7b9
commit
7bef465e9b
4 changed files with 6 additions and 1 deletions
3
range.c
3
range.c
|
@ -1141,6 +1141,9 @@ rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp)
|
|||
e = RANGE_END(range);
|
||||
excl = EXCL(range);
|
||||
}
|
||||
else if (RTEST(rb_obj_is_kind_of(range, rb_cArithSeq))) {
|
||||
return (int)Qfalse;
|
||||
}
|
||||
else {
|
||||
VALUE x;
|
||||
b = rb_check_funcall(range, id_beg, 0, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue