-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Truffle] remove_const doesn't completely clear a module's name #3858
Comments
Just as a general note, the JRuby bug that |
|
This workaround is very confusing though as it produces twice 2 classes with the same name in the chain: |
While having two classes with the same name in the ancestry chain is confusing, this is also what MRI does. My phrasing around the term "anonymous" was ambiguous. Benoit's follow-up is accurate. I tried reverting 7a224a5 and the sample code outputs the same result as with the commit present. It appears safe to revert. |
* See #3858 for background. * Fix WeakRef superclass.
Closed by 7ed9a36 |
rspec-support
has a JRuby-specific fix that exposes a flaw in ourremove_const
implementation. It basically replaces a class with a subclass by usingremove_const
to remove the previous definition. Normally, a class cannot subclass itself, butremove_const
should make the previous definition anonymous, at which point it can be subclassed.A reduced example is:
In MRI, this prints "Called X". In JRuby+Truffle, this results in a
TypeError
with a message of ``Support': superclass mismatch for class RSpec::Support::MethodSignature`.This is currently a blocker for many cases where rspec is used.
The text was updated successfully, but these errors were encountered: