Actions
Bug #22189
closed`Enumerator::Lazy#to_enum` does not accept method names as strings
Bug #22189:
`Enumerator::Lazy#to_enum` does not accept method names as strings
Description
Kernel#to_enum accepts a String as well as a Symbol.
[1,2,3].to_enum(:map).to_a #=> [1, 2, 3]
[1,2,3].to_enum("map").to_a #=> [1, 2, 3]
[1,2,3].lazy.to_enum(:map).to_a #=> [1, 2, 3]
[1,2,3].lazy.to_enum("map").to_a #=> []
Related to [Bug #7877].
Updated by nobu (Nobuyoshi Nakada) about 1 month ago
- Status changed from Open to Closed
Applied in changeset git|aaf54aa08b0ed73ae21786b5341f1ffc51659911.
[Bug #22189] Lazy to_enum should accept String method names too
Since lazy_use_super_method is the Symbol-to-Symbol mapping,
convert the given method name to a Symbol before consulting that
table.
Updated by k0kubun (Takashi Kokubun) about 1 month ago
- Backport changed from 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED to 3.3: REQUIRED, 3.4: REQUIRED, 4.0: DONE
ruby_4_0 ca6c51ccc21cf9690eb4c11e0bfb97e3643c19db merged revision(s) aaf54aa08b0ed73ae21786b5341f1ffc51659911.
Updated by nagachika (Tomoyuki Chikanaga) 5 days ago
- Backport changed from 3.3: REQUIRED, 3.4: REQUIRED, 4.0: DONE to 3.3: REQUIRED, 3.4: DONE, 4.0: DONE
ruby_3_4 7b0b33ab9b1b944df4980365281f75bf6529cdeb merged revision(s) aaf54aa08b0ed73ae21786b5341f1ffc51659911.
Actions