Actions
Feature #11476
closedMethods defined in Refinements cannot be called via send
Feature #11476:
Methods defined in Refinements cannot be called via send
[ruby-core:<unknown>]
Description
Actions
Added by matsuda (Akira Matsuda) almost 11 years ago. Updated almost 10 years ago.
Description
It's an intended behavior that Kernel#send ignores refinements as described at https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/RefinementsSpec
What do you think of it, Matz?
Aah, I'm sorry that I missed that part of the documentation.
But indeed I felt the behaviour weird while using the feature in a real-world library.
Accepted.
The current behavior is according to the direct interpretation of the refinement spec. But many people expect send to be another form of a method call (including refinement). And now I agree with it.
Matz
Applied in changeset r56450.
vm_insnhelper.c: refinements with send
Kernel#send and BasicObject#__send__. [Feature #11476]