[#115244] [Ruby master Feature#19987] add sample method to Range — "horv77@... (Andras Horvath) via ruby-core" <ruby-core@...>
Issue #19987 has been reported by horv77@protonmail.com (Andras Horvath).
6 messages
2023/11/05
[#115247] [Ruby master Feature#19988] AI for inner code behavior analysis at runtime — "horv77@... (Andras Horvath) via ruby-core" <ruby-core@...>
Issue #19988 has been reported by horv77@protonmail.com (Andras Horvath).
3 messages
2023/11/05
[#115404] Ruby 3.2.2 - rbconfig.rb's MAKEFILE_CONFIG — Jay Mav via ruby-core <ruby-core@...>
Hello Ruby Dev Team,
4 messages
2023/11/17
[ruby-core:115500] [Ruby master Bug#20003] Array#rassoc does not preform implicit conversion
From:
"mame (Yusuke Endoh) via ruby-core" <ruby-core@...>
Date:
2023-11-28 07:21:11 UTC
List:
ruby-core #115500
Issue #20003 has been updated by mame (Yusuke Endoh).
Thanks, I will merge it.
----------------------------------------
Bug #20003: Array#rassoc does not preform implicit conversion
https://bugs.ruby-lang.org/issues/20003#change-105429
* Author: temabolshakov (Tema Bolshakov)
* Status: Open
* Priority: Normal
* ruby -v: 3.2.2
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
There is a difference between behaviour of Array#assoc and Array#rassoc. The first one performs implicit conversion (calls #to_ary) while the former does not.
``` ruby
class ArrayConvertible
def initialize(*values)
@values = values;
end
def to_ary
@values
end
end
s1 = [1, 2]
s2 = ArrayConvertible.new(2, 3)
a = [s1, s2]
```
The `a.assoc(2)` call returns `[2, 3]` as expected. However, `a.rassoc(3)` returns `nil`
**Expected behaviour**: `a.rassoc(3)` returns `[2, 3]` in such cases.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/