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] Updates to Array#{map, map!}. #2714
Conversation
toEnumNode = insert(DispatchHeadNodeFactory.createMethodCall(getContext())); | ||
} | ||
|
||
return toEnumNode.call(frame, array, "to_enum", null, getContext().getCoreLibrary().getMapBangSymbol()); |
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.
This is a very common pattern - maybe we should have an annotation on @CoreMethod
called toEnumIfNoBlock
?
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.
I see 90 occurrences of returns an Enumerator
in the spec/ruby directory so I agree it would probably make a good annotation. I think this should be a different PR though.
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.
Yeah - do you want to take that on? If you look at the accessors of the other properties in @CoreMethod
you should be able to find the code where they are inserted into the core method prelude.
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.
@chrisseaton yes, ill give it a try
We've got spec failures here but they look unrelated to your work. I'll try and fix them and then re-run the specs here later. |
5cc7cad
to
f00f739
Compare
@chrisseaton extra lines removed |
[Truffle] Updates to Array#{map, map!}.
No description provided.