-
Notifications
You must be signed in to change notification settings - Fork 186
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
[Compatibility] Add Module#refinements
#3093
[Compatibility] Add Module#refinements
#3093
Conversation
@@ -1835,6 +1835,21 @@ def test_used_modules | |||
assert_equal [ref::RefB, ref::RefA], ref::Combined::USED_MODS | |||
end | |||
|
|||
def test_refinements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
@Specialization | ||
protected RubyArray refinements(RubyModule self) { | ||
return createArray(self.fields.getRefinements().values().toArray()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a TruffleBoundary (on the specialization to keep it simple) for the .values()
and .toArray()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
7fb546c
to
da66bcb
Compare
da66bcb
to
1f012bb
Compare
An MRI test is failing (we should try to run those on GitHub Actions):
|
a6bc603
to
54d0c5d
Compare
@eregon To respect ordering I switched to linked hash map, which has I believe has a minor disadvantage on create (in time) as well as I believe using atomicity via |
There are two problems with that:
I think the test should allow both, ordering there seems artificial and unnecessary, it will not affect method lookup semantics, as anyway it's a single refinement module per class/module being refined inside a namespace module. |
54d0c5d
to
3965709
Compare
@eregon Removed that change and tagged the MRI test. |
3965709
to
af5b297
Compare
Source: #3039
Module#refinements has been added. [Feature #12737]