Skip to content

Commit

Permalink
Fix NoMethodError#message when receiver is an instance of an anonymou…
Browse files Browse the repository at this point in the history
…s class
  • Loading branch information
andrykonchin committed Dec 18, 2024
1 parent 3290b86 commit a9fcc99
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions spec/tags/core/exception/no_method_error_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ def self.receiver_string(receiver)
"module #{receiver}"
else
klass = Primitive.metaclass(receiver)
if klass.name
"an instance of #{klass.name}"
end
# else fall through to rb_any_to_s
"an instance of #{klass}"
end
rescue Exception # rubocop:disable Lint/RescueException
nil
Expand Down

0 comments on commit a9fcc99

Please sign in to comment.