Actions
Bug #14748
closedInconsistent (and regressed from 2.4) behavior on `Array#min` and max between array literals and arrays
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
Description
Array#min
and Array#max
have different behavior depending on whether or not they are called with array literals:
$ ruby -e 'puts([1.0, 1].min); one_f = 1.0; one = 1; puts([one_f, one].min)'
1.0
1
This is a regression from 2.4, where both forms would return 1.0
.
I believe this to be a bug introduced by https://bugs.ruby-lang.org/issues/12172 -- disassembly reveals that only the second form uses opt_newarray_min
Updated by Hanmac (Hans Mackowiak) over 6 years ago
Related to this?
https://bugs.ruby-lang.org/issues/14350
Updated by mame (Yusuke Endoh) over 6 years ago
- Status changed from Open to Closed
This is already fixed in trunk at r61766. Please wait for ruby 2.5.2.
(Note that #12172 is innocent because opt_newarray_min is included in 2.4 :-)
Actions
Like0
Like0Like0