Range#size returns nil for (.."a") and (nil..)

Fixes [Bug #18983]
This commit is contained in:
Yusuke Endoh 2022-10-21 13:39:15 +09:00
parent e72c5044ce
commit e026368061
Notes: git 2022-10-21 07:36:07 +00:00
3 changed files with 28 additions and 6 deletions

View file

@ -816,7 +816,9 @@ range_size(VALUE range)
}
}
else if (NIL_P(b)) {
return DBL2NUM(HUGE_VAL);
if (rb_obj_is_kind_of(e, rb_cNumeric)) {
return DBL2NUM(HUGE_VAL);
}
}
return Qnil;