diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-10-12 00:01:37 -0700 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-11-28 19:57:04 +0900 |
commit | 5069c5f5214ce68df8b3954321ad9114c5368dc3 (patch) | |
tree | 31d00bf1ecc7f3eac4722e9d417728d241b643b3 /test/csv | |
parent | 4325f080862b36a3e3ddee472169f65758612ad3 (diff) | |
download | ruby-5069c5f5214ce68df8b3954321ad9114c5368dc3.tar.gz |
Honor refinements for modules that prepend other modules
This previously did not work, and the reason it did not work is
that:
1) Refining a module or class that prepends other modules places
the refinements in the class itself and not the origin iclass.
2) Inclusion of a module that prepends other modules skips the
module itself, including only iclasses for the prepended modules
and the origin iclass.
Those two behaviors combined meant that the method table for the
refined methods for the included module never ends up in the
method lookup chain for the class including the module.
Fix this by not skipping the module itself when the module is
included. This requires some code rearranging in
rb_include_class_new to make sure the correct method tables and
origin settings are used for the created iclass.
As origin iclasses shouldn't be exposed to Ruby, this also
requires skipping modules that have origin iclasses in
Module#ancestors (classes that have origin iclasses were already
skipped).
Fixes [Bug #16242]
Diffstat (limited to 'test/csv')
0 files changed, 0 insertions, 0 deletions