[prototype runtime] Avoid alias for methods defined in another module #1457
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
define_method
anddefine_singleton_method
can take UnboundMethod in second argument.In addition, it can be specified even for methods of a completely different module.
For example, erubi uses this technique.
https://github.com/jeremyevans/erubi/blob/4d24561e79e291208996892800a5cb9d11b8d2af/lib/erubi.rb#L23
rbs prototype runtime
produces the following output for the current erubi.However, the specified method does not exist.
To avoid this problem, I suggest that in this case the output be as a method definition, not an alias.