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 believe the problem is that our "findImplementer" logic for module methods ends up jumping above Enumerable in the search, due to the same module appearing in the hierarchy twice (due to lazy prepends).
The text was updated successfully, but these errors were encountered:
Ok, I think I'm wrong. In monitoring a method search for the code above, we do walk the hierarchy correctly, but when it gets to the A module it only searches its direct method table. Because we've prepended something into A, that table is empty.
My original fix for this was to make IncludedModuleWrapper keep searching prepended items until it finds a non-prepended, but that didn't seem to fix it.
The problem here was that I broke my prepend-searching fix.
In 7ac2331, I fixed prepends-in-a-module by searching the module's ancestors. However I searched too deeply, going into includes above the module that normally are not searched (they are copied into target hierarchy at include time).
Then in c725c69 I fixed the search to not go so deep...but I broke it by making it start at this – the IncludedModuleWrapper – rather than at origin – the actual module. That resulted in it going back to old behavior.
The new fix, in b9473af, restores the proper starting point and terminates the search by looking for methodLocation (which indicates the module under which prepends should go). The final search covers the module itself, and all is well.
This code should work and it doesn't. This is the cause of the Rails master "each_with_index" bug when running tests:
I believe the problem is that our "findImplementer" logic for module methods ends up jumping above Enumerable in the search, due to the same module appearing in the hierarchy twice (due to lazy prepends).
The text was updated successfully, but these errors were encountered: