Skip to content

Commit

Permalink
Actually try to coerce arg with to_str
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Nov 3, 2023
1 parent 3b72d52 commit d9359bc
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 8 deletions.
5 changes: 3 additions & 2 deletions core/src/main/java/org/jruby/RubyGlobal.java
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,12 @@ private IRubyObject case_aware_op_aset(ThreadContext context, IRubyObject key, f
}

protected static IRubyObject verifyStringLike(ThreadContext context, IRubyObject test) {
if (!isStringLike(test)) {
IRubyObject string = test.checkStringType();
if (string.isNil()) {
throw context.runtime.newTypeError("no implicit conversion of " + test.getMetaClass() + " into String");
}

return test;
return string;
}

private static RubyString verifyValidKey(ThreadContext context, RubyString key, IRubyObject value) {
Expand Down
1 change: 0 additions & 1 deletion spec/tags/ruby/core/env/delete_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/ruby/core/env/has_key_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/ruby/core/env/include_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/tags/ruby/core/env/key_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/ruby/core/env/member_tags.txt

This file was deleted.

0 comments on commit d9359bc

Please sign in to comment.