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) 20 days 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) 17 days 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.
Actions