You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wouldn't expect this to work on CRuby, it's a probably a remnant of 1.8 which accepted a mix of String and Symbols for various methods.
Also it's quite inefficient to pass a String to inject, it will have to intern it, while a Symbol is already interned.
So I think no code should use inject(String).
Nevertheless we should fix it for compatibility, but it is low priority unless used in a gem or something.
I stumbled upon this while replacing send for inject on personal code, the tests were old and still used Strings for the binary operations.
I understand it is low priority, probably affects no gem.
I reported it because it is unexpected that it fails for Arrays, but works for Range and Hash.
The expected behavior is the same for operations specified with Symbol and String objects.
ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-linux]
truffleruby 22.3.1, like ruby 3.0.3, GraalVM CE Native [x86_64-linux]
The text was updated successfully, but these errors were encountered: