Skip to content

Commit e751e66

Browse files
committed
[GR-18163] Support refinements for #to_s called by string interpolation (#2110).
PullRequest: truffleruby/2040
2 parents 5e5b7b9 + 0b8c7f8 commit e751e66

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Compatibility:
4141
* Fix arity for `Proc` (#2098, @ssnickolay)
4242
* Check bounds for `FFI::Pointer` accesses when the size of the memory behind is known.
4343
* Implement negative line numbers for eval (#1482).
44+
* Support refinements for `#to_s` called by string interpolation (#2110, @ssnickolay)
4445

4546
Performance:
4647

spec/tags/core/module/refine_tags.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
fails:Module#refine for methods accessed indirectly is honored by string interpolation
21
fails:Module#refine for methods accessed indirectly is honored by Kernel#respond_to?
32
slow:Module#refine method lookup looks in the included modules for builtin methods

src/main/java/org/truffleruby/core/cast/ToSNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected RubyString toS(RubyString string) {
3434
@Specialization(guards = "!isRubyString(object)")
3535
protected RubyString toSFallback(VirtualFrame frame, Object object,
3636
@Cached DispatchNode callToSNode) {
37-
final Object value = callToSNode.call(object, "to_s");
37+
final Object value = callToSNode.dispatch(frame, object, "to_s", null, EMPTY_ARGUMENTS);
3838

3939
if (value instanceof RubyString) {
4040
return (RubyString) value;

0 commit comments

Comments
 (0)